Let's say I:
mallocapthread_tfor holding a thread contextpthread_createwith as user parameter the pointer to thepthread_tstructure
In other words, the thread function has access to its pthread_t context structure. Now here is the tricky bit:
How can the pthread exit on its own and get the pthread_t context freed somehow? i.e. is it possible not to involve the parent thread? (no mutex/join etc.)
Think of this as a "lightweight process".
(and no the thread cannot free() the structure just before exiting its thread_func.