On Tue, Apr 5, 2011 at 8:29 AM, Lassi Tuura <[email protected]> wrote:
>
> As far as I can tell GLIBC implementation is basically just an object on
> stack, destroyed if stack is unwound. I guess thread cancellation or exit
> does the latter automatically.
You're right. It doesn't work. We really need a atexit() type API for
cleaning up on thread exit.
This is generally done by having all pthread_create() calls go through
your own wrapper.
MyThreadCreate()
{
// Thread create hooks
user_specified_func();
// Thread exit hooks
}
CreateThread()
{
pthread_create(... MyThreadCreate, ..);
}
But libunwind being a library, has no control over how threads are
created. One possibility is to just provide the hooks that people who
do have control over their thread creation can call and document it.
-Arun
_______________________________________________
Libunwind-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/libunwind-devel