forked from I2P_Developers/i2p.i2p
Who was the idiot who came up with the idea that booleans should be numbers?
This commit is contained in:
@@ -43,7 +43,7 @@ Mutex::Mutex(void)
|
||||
assert(mutex != NULL);
|
||||
#else
|
||||
int rc = pthread_mutex_init(&mutex, NULL);
|
||||
assert(!rc);
|
||||
assert(rc == 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -54,10 +54,10 @@ Mutex::~Mutex(void)
|
||||
{
|
||||
#ifdef WINTHREAD
|
||||
BOOL rc = CloseHandle(mutex);
|
||||
assert(!rc);
|
||||
assert(rc);
|
||||
#else
|
||||
int rc = pthread_mutex_destroy(&mutex);
|
||||
assert(!rc);
|
||||
assert(rc == 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ void Mutex::lock(void)
|
||||
assert(rc != WAIT_FAILED);
|
||||
#else
|
||||
int rc = pthread_mutex_lock(&mutex);
|
||||
assert(!rc);
|
||||
assert(rc == 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -82,9 +82,9 @@ void Mutex::unlock(void)
|
||||
{
|
||||
#ifdef WINTHREAD
|
||||
BOOL rc = ReleaseMutex(mutex);
|
||||
assert(!rc);
|
||||
assert(rc);
|
||||
#else
|
||||
int rc = pthread_mutex_unlock(&mutex);
|
||||
assert(!rc);
|
||||
assert(rc == 0);
|
||||
#endif
|
||||
}
|
||||
|
@@ -75,10 +75,10 @@ void Thread::kill(void)
|
||||
#endif
|
||||
#ifdef WINTHREAD
|
||||
BOOL rc = TerminateThread(handle, 0);
|
||||
assert(!rc);
|
||||
assert(rc);
|
||||
#else
|
||||
int rc = pthread_cancel(id);
|
||||
assert(!rc);
|
||||
assert(rc == 0);
|
||||
#endif
|
||||
running = false;
|
||||
running_m.unlock();
|
||||
@@ -101,7 +101,7 @@ void Thread::start(void)
|
||||
assert(handle != NULL);
|
||||
#else
|
||||
int rc = pthread_create(&id, NULL, &the_thread, this);
|
||||
assert(!rc);
|
||||
assert(rc == 0);
|
||||
#endif
|
||||
// Wait until `running' is set
|
||||
running_m.lock();
|
||||
|
Reference in New Issue
Block a user