bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #48179] GSRegisterCurrentThread should send NSWillBecomeMultiThread


From: Larry Campbell
Subject: [bug #48179] GSRegisterCurrentThread should send NSWillBecomeMultiThreadedNotification
Date: Wed, 8 Jun 2016 18:59:34 +0000 (UTC)
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/601.6.17 (KHTML, like Gecko) Version/9.1.1 Safari/601.6.17

Follow-up Comment #1, bug #48179 (project gnustep):

Note that this should be done only if called from a non-main thread. Note also
that the comment in front of the implementation of GSRegisterCurrentThread()
says:

 *   Sends out a <code>NSWillBecomeMultiThreadedNotification</code>           
                                                     
 *   if the process was not already multithreaded.                            
                                                     

which is not actually true (the patch below makes the comment true).

The following patch works for me:

***
/home/lcampbel/dev/mc7883/akamai/gnustep-base/gnustep-base-1.24.8/Source/NSThread.m
     2016-06-08
13:13:07.000000000 -0400
--- ./NSThread.m        2016-06-08 14:08:17.000000000 -0400
***************
*** 591,596 ****
--- 591,598 ----
        [[NSGarbageCollector defaultCollector] disableCollectorForPointer:
t];
        pthread_setspecific(thread_object_key, t);
        GS_CONSUMED(t);
+       if (defaultThread != nil && t != defaultThread)
+         gnustep_base_thread_callback();
        return YES;
      }
    return NO;


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?48179>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]