mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 17:10:48 +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
b8ccc9459d
commit
a14a8a49b6
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…
Reference in a new issue