From 6bf1398b824c013184548277eb8f2dbccd4d6fc5 Mon Sep 17 00:00:00 2001 From: Eric Petit Date: Sun, 5 Jun 2005 10:17:10 +0000 Subject: [PATCH] Use win32 native threads (you still have to --enable-pthread to use them, though) git-svn-id: svn://svn.videolan.org/x264/trunk@250 df754926-b1dd-0310-bc7b-ec298dee348c --- configure | 5 +---- encoder/encoder.c | 6 ++++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 7e899f7e..e12ffaf9 100755 --- a/configure +++ b/configure @@ -155,10 +155,7 @@ for opt do CFLAGS="$CFLAGS -DHAVE_PTHREAD=1" pthread="yes" case $SYS in - MINGW) - LDFLAGS="$LDFLAGS -lpthreadGC2" - ;; - BEOS) + MINGW|CYGWIN|BEOS) ;; *) LDFLAGS="$LDFLAGS -lpthread" diff --git a/encoder/encoder.c b/encoder/encoder.c index 6dcb6320..d997c3c9 100644 --- a/encoder/encoder.c +++ b/encoder/encoder.c @@ -32,6 +32,12 @@ #define pthread_t thread_id #define pthread_create(t,u,f,d) *(t)=spawn_thread(f,"",10,d) #define pthread_join(t,s) wait_for_thread(t,(long*)s) +#elif defined(__WIN32__) +#include +#define pthread_t HANDLE +#define pthread_create(t,u,f,d) *(t)=CreateThread(NULL,0,f,d,0,NULL) +#define pthread_join(t,s) WaitForSingleObject(t,INFINITE); \ + CloseHandle(t) #else #include #endif -- 2.47.3