projects
/
silc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added SILC Server library.
[silc.git]
/
lib
/
silcutil
/
beos
/
silcbeosmutex.c
diff --git
a/lib/silcutil/beos/silcbeosmutex.c
b/lib/silcutil/beos/silcbeosmutex.c
index 1c9e113a7f1262a701f90795db545aefe7f21e27..2e1cef0cb7f6818518b419905b16fea58b6236a0 100644
(file)
--- a/
lib/silcutil/beos/silcbeosmutex.c
+++ b/
lib/silcutil/beos/silcbeosmutex.c
@@
-19,17
+19,16
@@
/* I used Apache's APR code as a reference here. */
/* $Id$ */
/* I used Apache's APR code as a reference here. */
/* $Id$ */
-#include "silc
includes
.h"
+#include "silc.h"
#ifdef SILC_THREADS
/* SILC Mutex structure */
struct SilcMutexStruct {
#ifdef SILC_THREADS
/* SILC Mutex structure */
struct SilcMutexStruct {
- int sema_count;
sem_id sema;
};
sem_id sema;
};
-
b
ool silc_mutex_alloc(SilcMutex *mutex)
+
SilcB
ool silc_mutex_alloc(SilcMutex *mutex)
{
int ret;
{
int ret;
@@
-43,7
+42,6
@@
bool silc_mutex_alloc(SilcMutex *mutex)
return FALSE;
}
return FALSE;
}
- (*mutex)->sema_count = 0;
(*mutex)->sema = ret;
return TRUE;
(*mutex)->sema = ret;
return TRUE;
@@
-57,18
+55,14
@@
void silc_mutex_free(SilcMutex mutex)
void silc_mutex_lock(SilcMutex mutex)
{
void silc_mutex_lock(SilcMutex mutex)
{
- if (atomic_add(&mutex->sema_count, 1) > 0) {
- if (acquire_sem(mutex->sema) < B_NO_ERROR)
- assert(FALSE);
- }
+ if (acquire_sem(mutex->sema) < B_NO_ERROR)
+ assert(FALSE);
}
void silc_mutex_unlock(SilcMutex mutex)
{
}
void silc_mutex_unlock(SilcMutex mutex)
{
- if (atomic_add(&mutes->sema_count, -1) > 1) {
- if (release_sem(mutex->sema) < B_NO_ERROR)
- assert(FALSE);
- }
+ if (release_sem(mutex->sema) < B_NO_ERROR)
+ assert(FALSE);
}
#endif /* SILC_THREADS */
}
#endif /* SILC_THREADS */