[bug #48179] GSRegisterCurrentThread should send NSWillBecomeMultiThreadedNotification

Larry Campbell <[email protected]>
Newsgroups gmane.comp.lib.gnustep.bugs
Message-ID <[email protected]>
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/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.