summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBryan Ischo <bryan@ischo.com>2008-08-12 13:04:10 +0000
committerBryan Ischo <bryan@ischo.com>2008-08-12 13:04:10 +0000
commit06fcf9839f35d1bbac18819886375b8232d73f35 (patch)
treeb336da3212c8846f7dddaf6297ea153f124ecbd4 /src
parent953d590bd9a3508d37552efb89aaa68344466d80 (diff)
downloadceph-libs3-06fcf9839f35d1bbac18819886375b8232d73f35.tar.gz
* Implement required pthreads functions for Windows
Diffstat (limited to 'src')
-rw-r--r--src/mingw_functions.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/mingw_functions.c b/src/mingw_functions.c
index cebad07..ce86c8e 100644
--- a/src/mingw_functions.c
+++ b/src/mingw_functions.c
@@ -24,8 +24,39 @@
*
************************************************************************** **/
+#include <pthread.h>
#include <sys/utsname.h>
+unsigned long pthread_self()
+{
+ return (unsigned long) GetCurrentThreadId();
+}
+
+
+void pthread_mutex_init(pthread_mutex_t *mutex, void *v)
+{
+ InitializeCriticalSection(&(mutex->criticalSection));
+}
+
+
+void pthread_mutex_lock(pthread_mutex_t *mutex)
+{
+ EnterCriticalSection(&(mutex->criticalSection));
+}
+
+
+void pthread_mutex_unlock(pthread_mutex_t *mutex)
+{
+ LeaveCriticalSection(&(mutex->criticalSection));
+}
+
+
+void pthread_mutex_destroy(pthread_mutex_t *mutex)
+{
+ DeleteCriticalSection(&(mutex->criticalSection));
+}
+
+
int uname(struct utsname *u)
{
OSVERSIONINFO info;