Re: libcxx std::thread leaks 48 bytes due to missing implementation of pthread destructor

2020-06-29 Thread Gregory Nutt
I have to get something out the door today, but I'll be back on this tomorrow and will contribute to your branch. In a pinch, you can use a pthread_cleanup() callback.

Re: libcxx std::thread leaks 48 bytes due to missing implementation of pthread destructor

2020-06-29 Thread Anthony Merlino
Greg, I have to get something out the door today, but I'll be back on this tomorrow and will contribute to your branch. I don't mind implementing it however the right way is - I just don't necessarily know the right way. So I'll follow your lead. I also need to get caught up to master anyway. My

Re: libcxx std::thread leaks 48 bytes due to missing implementation of pthread destructor

2020-06-29 Thread Gregory Nutt
Would userpace_s need to have an additional function pointer for pthread_cleanup? Similar to pthread_startup? Is the up_pthread_start/pthread_startup functions a good example to follow for how to call in user mode? If you look at Issue 1263, that is not what I am proposing: https://gith

Re: libcxx std::thread leaks 48 bytes due to missing implementation of pthread destructor

2020-06-29 Thread Gregory Nutt
On 6/28/2020 12:41 PM, Gregory Nutt wrote: Would userpace_s need to have an additional function pointer for pthread_cleanup? Similar to pthread_startup? Is the up_pthread_start/pthread_startup functions a good example to follow for how to call in user mode? If you look at Issue 1263, that

Re: libcxx std::thread leaks 48 bytes due to missing implementation of pthread destructor

2020-06-28 Thread Gregory Nutt
... one objective that I have is to move all of the pthread logic out of the kernel and into libs/libs/pthread.  The pthreads interfaces are not part of the kernel in other Unix-like implementations. The kernel does provide certain necessary hooks, but the majority of the implementation of t

Re: libcxx std::thread leaks 48 bytes due to missing implementation of pthread destructor

2020-06-28 Thread Gregory Nutt
Would userpace_s need to have an additional function pointer for pthread_cleanup? Similar to pthread_startup? Is the up_pthread_start/pthread_startup functions a good example to follow for how to call in user mode? If you look at Issue 1263, that is not what I am proposing: https://github.c

Re: libcxx std::thread leaks 48 bytes due to missing implementation of pthread destructor

2020-06-28 Thread Anthony Merlino
Greg, Would userpace_s need to have an additional function pointer for pthread_cleanup? Similar to pthread_startup? Is the up_pthread_start/pthread_startup functions a good example to follow for how to call in user mode? Anthony On Sun, Jun 28, 2020 at 1:39 PM Gregory Nutt wrote: > Hi, Antho

Re: libcxx std::thread leaks 48 bytes due to missing implementation of pthread destructor

2020-06-28 Thread Gregory Nutt
Hi, Anthony, I just found an issue with using libcxx std::thread library on NuttX. The std::thread implementation uses pthread_key_create and pthread_setspecific in order to setup a destructor that should be called to cleanup the memory. Of course, it became pretty obvious what was wrong once I

libcxx std::thread leaks 48 bytes due to missing implementation of pthread destructor

2020-06-28 Thread Anthony Merlino
Hi all, I just found an issue with using libcxx std::thread library on NuttX. The std::thread implementation uses pthread_key_create and pthread_setspecific in order to setup a destructor that should be called to cleanup the memory. Of course, it became pretty obvious what was wrong once I read th