Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Since pthread_once() is called only once in a process, also the destructor in pthread_key_create() is the same for all threads. But we use dynamic memory for threads and static memory for the main thread. Therefore, we have to check in destructor (and we cannot use standard free()) for freeing static memory if someone will use pthread_exit() in main(). Fixes #15
- Loading branch information