projects
/
silc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Do not include silcdefs.h in installed headers anymore. Include
[silc.git]
/
lib
/
silcutil
/
unix
/
silcunixmutex.c
diff --git
a/lib/silcutil/unix/silcunixmutex.c
b/lib/silcutil/unix/silcunixmutex.c
index 1b531b0a481300a2384224413209a60f9be228fc..6b92ee3286d7a6c56cc79cee37607639e7f61aa4 100644
(file)
--- a/
lib/silcutil/unix/silcunixmutex.c
+++ b/
lib/silcutil/unix/silcunixmutex.c
@@
-21,39
+21,47
@@
#include "silcincludes.h"
#include "silcincludes.h"
-#ifdef SILC_THREADS
-
/* SILC Mutex structure */
struct SilcMutexStruct {
/* SILC Mutex structure */
struct SilcMutexStruct {
+#ifdef SILC_THREADS
pthread_mutex_t mutex;
pthread_mutex_t mutex;
+#else
+ void *tmp;
+#endif /* SILC_THREADS */
};
bool silc_mutex_alloc(SilcMutex *mutex)
{
};
bool silc_mutex_alloc(SilcMutex *mutex)
{
+#ifdef SILC_THREADS
*mutex = silc_calloc(1, sizeof(**mutex));
if (*mutex == NULL)
return FALSE;
pthread_mutex_init(&(*mutex)->mutex, NULL);
*mutex = silc_calloc(1, sizeof(**mutex));
if (*mutex == NULL)
return FALSE;
pthread_mutex_init(&(*mutex)->mutex, NULL);
+#endif /* SILC_THREADS */
return TRUE;
}
void silc_mutex_free(SilcMutex mutex)
{
return TRUE;
}
void silc_mutex_free(SilcMutex mutex)
{
+#ifdef SILC_THREADS
pthread_mutex_destroy(&mutex->mutex);
silc_free(mutex);
pthread_mutex_destroy(&mutex->mutex);
silc_free(mutex);
+#endif /* SILC_THREADS */
}
void silc_mutex_lock(SilcMutex mutex)
{
}
void silc_mutex_lock(SilcMutex mutex)
{
+#ifdef SILC_THREADS
if (pthread_mutex_lock(&mutex->mutex))
assert(FALSE);
if (pthread_mutex_lock(&mutex->mutex))
assert(FALSE);
+#endif /* SILC_THREADS */
}
void silc_mutex_unlock(SilcMutex mutex)
{
}
void silc_mutex_unlock(SilcMutex mutex)
{
+#ifdef SILC_THREADS
if (pthread_mutex_unlock(&mutex->mutex))
assert(FALSE);
if (pthread_mutex_unlock(&mutex->mutex))
assert(FALSE);
-}
-
#endif /* SILC_THREADS */
#endif /* SILC_THREADS */
+}