Index: src/OFRunLoop.m ================================================================== --- src/OFRunLoop.m +++ src/OFRunLoop.m @@ -624,13 +624,10 @@ void *pool; OFDate *now; OFTimer *timer; OFDate *nextTimer; -#ifdef OF_HAVE_THREADS - of_memory_read_barrier(); -#endif if (!_running) break; pool = objc_autoreleasePoolPush(); now = [OFDate date]; @@ -711,17 +708,14 @@ } - (void)stop { _running = false; -#ifdef OF_HAVE_THREADS - of_memory_write_barrier(); -#endif #if defined(OF_HAVE_SOCKETS) [_streamObserver cancel]; #elif defined(OF_HAVE_THREADS) [_condition lock]; [_condition signal]; [_condition unlock]; #endif } @end Index: src/OFThreadPool.m ================================================================== --- src/OFThreadPool.m +++ src/OFThreadPool.m @@ -171,11 +171,10 @@ - (id)main { void *pool; - of_memory_read_barrier(); if (_terminate) return nil; pool = objc_autoreleasePoolPush(); @@ -184,11 +183,10 @@ [_queueCondition lock]; @try { of_list_object_t *listObject; - of_memory_read_barrier(); if (_terminate) { objc_autoreleasePoolPop(pool); return nil; } @@ -195,11 +193,10 @@ listObject = [_queue firstListObject]; while (listObject == NULL) { [_queueCondition wait]; - of_memory_read_barrier(); if (_terminate) { objc_autoreleasePoolPop(pool); return nil; } @@ -210,19 +207,17 @@ [_queue removeListObject: listObject]; } @finally { [_queueCondition unlock]; } - of_memory_read_barrier(); if (_terminate) { objc_autoreleasePoolPop(pool); return nil; } [job perform]; - of_memory_read_barrier(); if (_terminate) { objc_autoreleasePoolPop(pool); return nil; } @@ -229,11 +224,10 @@ objc_autoreleasePoolPop(pool); pool = objc_autoreleasePoolPush(); [_countCondition lock]; @try { - of_memory_read_barrier(); if (_terminate) { objc_autoreleasePoolPop(pool); return nil; } @@ -311,12 +305,10 @@ OFEnumerator *enumerator = [_threads objectEnumerator]; OFThreadPoolThread *thread; while ((thread = [enumerator nextObject]) != nil) thread->_terminate = true; - - of_memory_write_barrier(); } @finally { [_countCondition unlock]; } [_queueCondition broadcast];