Index: src/OFThread.m ================================================================== --- src/OFThread.m +++ src/OFThread.m @@ -96,17 +96,25 @@ 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 cStringWithEncoding: [OFLocalization encoding]]); + 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 @@ -365,16 +373,10 @@ if (!of_thread_new(&_thread, callMain, self, &_attr)) { [self release]; @throw [OFThreadStartFailedException exceptionWithThread: self]; } - - if (_name != nil) - of_thread_set_name( - [_name cStringWithEncoding: [OFLocalization encoding]]); - else - of_thread_set_name(class_getName([self class])); } - (id)join { if (_running == OF_THREAD_NOT_RUNNING || !of_thread_join(_thread))