diff options
author | Bryan Ischo <bryan@ischo.com> | 2008-08-12 13:04:10 +0000 |
---|---|---|
committer | Bryan Ischo <bryan@ischo.com> | 2008-08-12 13:04:10 +0000 |
commit | 06fcf9839f35d1bbac18819886375b8232d73f35 (patch) | |
tree | b336da3212c8846f7dddaf6297ea153f124ecbd4 /src/mingw_functions.c | |
parent | 953d590bd9a3508d37552efb89aaa68344466d80 (diff) | |
download | ceph-libs3-06fcf9839f35d1bbac18819886375b8232d73f35.tar.gz |
* Implement required pthreads functions for Windows
Diffstat (limited to 'src/mingw_functions.c')
-rw-r--r-- | src/mingw_functions.c | 31 |
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; |