I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 1b03e9a3 authored by mpc's avatar mpc Committed by zzz
Browse files

Who was the idiot who came up with the idea that booleans should be numbers?

parent 2b951e3f
No related branches found
No related tags found
No related merge requests found
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment