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:
Richard Frith-MacDonald 2010-02-02 14:25:58 +00:00
parent b8ccc9459d
commit a14a8a49b6

View file

@ -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);
}
}
}