@@ -246,11 +246,11 @@ } #endif - (id)main { - @throw [OFNotImplementedException exceptionWithClass: isa + @throw [OFNotImplementedException exceptionWithClass: [self class] selector: _cmd]; return nil; } @@ -259,12 +259,13 @@ } - (void)start { if (running == OF_THREAD_RUNNING) - @throw [OFThreadStillRunningException exceptionWithClass: isa - thread: self]; + @throw [OFThreadStillRunningException + exceptionWithClass: [self class] + thread: self]; if (running == OF_THREAD_WAITING_FOR_JOIN) { of_thread_detach(thread); [returnValue release]; } @@ -271,33 +272,36 @@ [self retain]; if (!of_thread_new(&thread, call_main, self)) { [self release]; - @throw [OFThreadStartFailedException exceptionWithClass: isa - thread: self]; + @throw [OFThreadStartFailedException + exceptionWithClass: [self class] + thread: self]; } running = OF_THREAD_RUNNING; } - (id)join { if (running == OF_THREAD_NOT_RUNNING || !of_thread_join(thread)) - @throw [OFThreadJoinFailedException exceptionWithClass: isa - thread: self]; + @throw [OFThreadJoinFailedException + exceptionWithClass: [self class] + thread: self]; running = OF_THREAD_NOT_RUNNING; return returnValue; } - (void)dealloc { if (running == OF_THREAD_RUNNING) - @throw [OFThreadStillRunningException exceptionWithClass: isa - thread: self]; + @throw [OFThreadStillRunningException + exceptionWithClass: [self class] + thread: self]; /* * We should not be running anymore, but call detach in order to free * the resources. */ @@ -348,11 +352,11 @@ self = [super init]; @try { if (!of_tlskey_new(&key)) @throw [OFInitializationFailedException - exceptionWithClass: isa]; + exceptionWithClass: [self class]]; initialized = YES; @synchronized (TLSKeys) { listObject = [TLSKeys appendObject: self]; @@ -402,11 +406,11 @@ - init { self = [super init]; if (!of_mutex_new(&mutex)) { - Class c = isa; + Class c = [self class]; [self release]; @throw [OFInitializationFailedException exceptionWithClass: c]; } initialized = YES; @@ -415,12 +419,13 @@ } - (void)lock { if (!of_mutex_lock(&mutex)) - @throw [OFMutexLockFailedException exceptionWithClass: isa - mutex: self]; + @throw [OFMutexLockFailedException + exceptionWithClass: [self class] + mutex: self]; } - (BOOL)tryLock { return of_mutex_trylock(&mutex); @@ -427,20 +432,21 @@ } - (void)unlock { if (!of_mutex_unlock(&mutex)) - @throw [OFMutexUnlockFailedException exceptionWithClass: isa - mutex: self]; + @throw [OFMutexUnlockFailedException + exceptionWithClass: [self class] + mutex: self]; } - (void)dealloc { if (initialized) if (!of_mutex_free(&mutex)) @throw [OFMutexStillLockedException - exceptionWithClass: isa + exceptionWithClass: [self class] mutex: self]; [super dealloc]; } @end @@ -454,11 +460,11 @@ - init { self = [super init]; if (!of_condition_new(&condition)) { - Class c = isa; + Class c = [self class]; [self release]; @throw [OFInitializationFailedException exceptionWithClass: c]; } conditionInitialized = YES; @@ -468,36 +474,36 @@ - (void)wait { if (!of_condition_wait(&condition, &mutex)) @throw [OFConditionWaitFailedException - exceptionWithClass: isa + exceptionWithClass: [self class] condition: self]; } - (void)signal { if (!of_condition_signal(&condition)) @throw [OFConditionSignalFailedException - exceptionWithClass: isa + exceptionWithClass: [self class] condition: self]; } - (void)broadcast { if (!of_condition_broadcast(&condition)) @throw [OFConditionBroadcastFailedException - exceptionWithClass: isa + exceptionWithClass: [self class] condition: self]; } - (void)dealloc { if (conditionInitialized) if (!of_condition_free(&condition)) @throw [OFConditionStillWaitingException - exceptionWithClass: isa + exceptionWithClass: [self class] condition: self]; [super dealloc]; } @end