*/
/* $Id$ */
-#include "silcincludes.h"
+#include "silc.h"
/* SILC Mutex structure */
struct SilcMutexStruct {
#ifdef SILC_THREADS
pthread_mutex_t mutex;
- unsigned int locked : 1;
#else
void *tmp;
#endif /* SILC_THREADS */
if (*mutex == NULL)
return FALSE;
pthread_mutex_init(&(*mutex)->mutex, NULL);
-#endif /* SILC_THREADS */
return TRUE;
+#else
+ return FALSE;
+#endif /* SILC_THREADS */
}
void silc_mutex_free(SilcMutex mutex)
if (mutex) {
if (pthread_mutex_lock(&mutex->mutex))
assert(FALSE);
- assert(mutex->locked == 0);
- mutex->locked = 1;
}
#endif /* SILC_THREADS */
}
{
#ifdef SILC_THREADS
if (mutex) {
- assert(mutex->locked == 1);
- mutex->locked = 0;
if (pthread_mutex_unlock(&mutex->mutex))
assert(FALSE);
}