summaryrefslogtreecommitdiff
path: root/src/win32/pthread.c
diff options
context:
space:
mode:
authorVicent Martí <tanoku@gmail.com>2012-05-05 14:22:53 -0700
committerVicent Martí <tanoku@gmail.com>2012-05-05 14:22:53 -0700
commit48ecd122ea6fb8cf12fb4029974c314e5d9efb62 (patch)
tree88f90fa8c9d903f072a2b1c647c51a9899e520c7 /src/win32/pthread.c
parent2218fd57a50ceb851cb131939bf0747e072e40f6 (diff)
parent4ef14af93517b3842bc0dfa24147cf10dd029582 (diff)
downloadlibgit2-48ecd122ea6fb8cf12fb4029974c314e5d9efb62.tar.gz
Merge pull request #659 from libgit2/development-merge
New-error-handling
Diffstat (limited to 'src/win32/pthread.c')
-rw-r--r--src/win32/pthread.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/win32/pthread.c b/src/win32/pthread.c
index 3db536848..3a186c8d9 100644
--- a/src/win32/pthread.c
+++ b/src/win32/pthread.c
@@ -7,13 +7,16 @@
#include "pthread.h"
-int pthread_create(pthread_t *GIT_RESTRICT thread,
- const pthread_attr_t *GIT_RESTRICT attr,
- void *(*start_routine)(void*), void *GIT_RESTRICT arg)
+int pthread_create(
+ pthread_t *GIT_RESTRICT thread,
+ const pthread_attr_t *GIT_RESTRICT attr,
+ void *(*start_routine)(void*),
+ void *GIT_RESTRICT arg)
{
GIT_UNUSED(attr);
- *thread = (pthread_t) CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)start_routine, arg, 0, NULL);
- return *thread ? GIT_SUCCESS : git__throw(GIT_EOSERR, "Failed to create pthread");
+ *thread = (pthread_t) CreateThread(
+ NULL, 0, (LPTHREAD_START_ROUTINE)start_routine, arg, 0, NULL);
+ return *thread ? 0 : -1;
}
int pthread_join(pthread_t thread, void **value_ptr)