@@ -120,15 +120,15 @@ OFThread *thread = (OFThread *)object; OFString *name; if (!of_tlskey_set(threadSelfKey, thread)) @throw [OFInitializationFailedException - exceptionWithClass: [thread class]]; + exceptionWithClass: thread.class]; thread->_pool = objc_autoreleasePoolPush(); - name = [thread name]; + name = thread.name; if (name != nil) of_thread_set_name( [name cStringWithEncoding: [OFLocale encoding]]); else of_thread_set_name(object_getClassName(thread)); @@ -296,11 +296,11 @@ #endif } + (void)sleepUntilDate: (OFDate *)date { - [self sleepForTimeInterval: [date timeIntervalSinceNow]]; + [self sleepForTimeInterval: date.timeIntervalSinceNow]; } + (void)yield { #ifdef OF_HAVE_SCHED_YIELD @@ -343,22 +343,22 @@ of_thread_exit(); } + (void)setName: (OFString *)name { - [[OFThread currentThread] setName: name]; + [OFThread currentThread].name = name; if (name != nil) of_thread_set_name( [name cStringWithEncoding: [OFLocale encoding]]); else - of_thread_set_name(class_getName([self class])); + of_thread_set_name(class_getName(self.class)); } + (OFString *)name { - return [[OFThread currentThread] name]; + return [OFThread currentThread].name; } + (void)of_createMainThread { mainThread = [[OFThread alloc] init]; @@ -374,11 +374,11 @@ self = [super init]; @try { if (!of_thread_attr_init(&_attr)) @throw [OFInitializationFailedException - exceptionWithClass: [self class]]; + exceptionWithClass: self.class]; } @catch (id e) { [self release]; @throw e; }