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

This commit is contained in:
mpc
2004-07-01 09:30:52 +00:00
committed by zzz
parent 2b951e3f61
commit 1b03e9a3ee
2 changed files with 9 additions and 9 deletions

View File

@@ -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
}

View File

@@ -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();