mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
windows fixup for pthread exit with null pointer
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39935 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3f18e3ce40
commit
3d6bd64ced
1 changed files with 14 additions and 3 deletions
|
@ -569,6 +569,17 @@ static void exitedThread(void *thread)
|
|||
{
|
||||
NSValue *ref;
|
||||
|
||||
if (0 == thread)
|
||||
{
|
||||
/* On some systems this is called with a null thread pointer,
|
||||
* so try to ger the NSThread object for the current thread.
|
||||
*/
|
||||
thread = pthread_getspecific(thread_object_key);
|
||||
if (0 == thread)
|
||||
{
|
||||
return; // no thread info
|
||||
}
|
||||
}
|
||||
RETAIN((NSThread*)thread);
|
||||
ref = NSValueCreateFromPthread(pthread_self());
|
||||
_willLateUnregisterThread(ref, (NSThread*)thread);
|
||||
|
@ -810,7 +821,7 @@ unregisterActiveThread(NSThread *thread)
|
|||
t = GSCurrentThread();
|
||||
if (t->_active == YES)
|
||||
{
|
||||
unregisterActiveThread (t);
|
||||
unregisterActiveThread(t);
|
||||
|
||||
if (t == defaultThread || defaultThread == nil)
|
||||
{
|
||||
|
@ -1742,7 +1753,7 @@ GSRunLoopInfoForThread(NSThread *aThread)
|
|||
* </p>
|
||||
*/
|
||||
BOOL
|
||||
GSRegisterCurrentThread (void)
|
||||
GSRegisterCurrentThread(void)
|
||||
{
|
||||
return [NSThread _createThreadForCurrentPthread];
|
||||
}
|
||||
|
@ -1762,7 +1773,7 @@ GSRegisterCurrentThread (void)
|
|||
* </p>
|
||||
*/
|
||||
void
|
||||
GSUnregisterCurrentThread (void)
|
||||
GSUnregisterCurrentThread(void)
|
||||
{
|
||||
unregisterActiveThread(GSCurrentThread());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue