mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-02 01:21:08 +00:00
exit when main thread exits
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29462 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
56f4c389a0
commit
59114c78f1
1 changed files with 10 additions and 1 deletions
|
@ -516,7 +516,16 @@ static void setThreadForCurrentThread(NSThread *t)
|
|||
GC_unregister_my_thread();
|
||||
#endif
|
||||
pthread_setspecific(thread_object_key, nil);
|
||||
pthread_exit(NULL);
|
||||
if (t == defaultThread || defaultThread == nil)
|
||||
{
|
||||
/* For the default thread, we exit the process.
|
||||
*/
|
||||
exit(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue