Differences From Artifact [e0cab8357e]:
- File
src/OFThread.m
— part of check-in
[1d0042a040]
at
2017-10-07 10:46:59
on branch 0.90
— OFThread: Fix setting the name on the wrong thread
The name of the thread may only be set from the thread itself. So the
thread should read the property on start and set its name. (user: js, size: 8737) [annotate] [blame] [check-ins using]
To Artifact [3fc1c7c412]:
- File
src/OFThread.m
— part of check-in
[1a502ac38c]
at
2017-10-07 15:14:19
on branch 0.90
— OFThread: Fix setting the name on the wrong thread
This time for real. (user: js, size: 8775) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | static of_tlskey_t threadSelfKey; static OFThread *mainThread; static void callMain(id object) { OFThread *thread = (OFThread *)object; if (!of_tlskey_set(threadSelfKey, thread)) @throw [OFInitializationFailedException exceptionWithClass: [thread class]]; thread->_pool = objc_autoreleasePoolPush(); /* * Nasty workaround for thread implementations which can't return a * pointer on join. */ # ifdef OF_HAVE_BLOCKS if (thread->_threadBlock != NULL) thread->_returnValue = [thread->_threadBlock() retain]; | > > > > > > > | 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | static of_tlskey_t threadSelfKey; static OFThread *mainThread; static void callMain(id object) { OFThread *thread = (OFThread *)object; OFString *name; if (!of_tlskey_set(threadSelfKey, thread)) @throw [OFInitializationFailedException exceptionWithClass: [thread class]]; thread->_pool = objc_autoreleasePoolPush(); name = [thread name]; if (name != nil) of_thread_set_name([name UTF8String]); else of_thread_set_name(object_getClassName(thread)); /* * Nasty workaround for thread implementations which can't return a * pointer on join. */ # ifdef OF_HAVE_BLOCKS if (thread->_threadBlock != NULL) thread->_returnValue = [thread->_threadBlock() retain]; |
︙ | ︙ | |||
346 347 348 349 350 351 352 | _running = OF_THREAD_RUNNING; if (!of_thread_new(&_thread, callMain, self, &_attr)) { [self release]; @throw [OFThreadStartFailedException exceptionWithThread: self]; } | < < < < < | 353 354 355 356 357 358 359 360 361 362 363 364 365 366 | _running = OF_THREAD_RUNNING; if (!of_thread_new(&_thread, callMain, self, &_attr)) { [self release]; @throw [OFThreadStartFailedException exceptionWithThread: self]; } } - (id)join { if (_running == OF_THREAD_NOT_RUNNING || !of_thread_join(_thread)) @throw [OFThreadJoinFailedException exceptionWithThread: self]; |
︙ | ︙ |