static void* dec_thread(void* arg) { int loop = 0; int icount = 0; FOUNDATION_UNUSED(arg); while (!thread_try_wait(0) && (loop < 65535)) { for (icount = 0; icount < 256; ++icount) { atomic_decr32(&val_32); atomic_decr64(&val_64); } ++loop; thread_yield(); } return 0; }
void* dec_thread( object_t thread, void* arg ) { int loop = 0; int icount = 0; while( !thread_should_terminate( thread ) && ( loop < 65535 ) ) { for( icount = 0; icount < 256; ++icount ) { atomic_decr32( &val_32 ); atomic_decr64( &val_64 ); } ++loop; thread_yield(); } return 0; }