Index: src/OFThread.m ================================================================== --- src/OFThread.m +++ src/OFThread.m @@ -95,17 +95,24 @@ 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 @@ -348,15 +355,10 @@ if (!of_thread_new(&_thread, callMain, self, &_attr)) { [self release]; @throw [OFThreadStartFailedException exceptionWithThread: self]; } - - if (_name != nil) - of_thread_set_name([_name UTF8String]); - else - of_thread_set_name(class_getName([self class])); } - (id)join { if (_running == OF_THREAD_NOT_RUNNING || !of_thread_join(_thread))