]> granicus.if.org Git - libx264/commitdiff
Use win32 native threads (you still have to --enable-pthread to use
authorEric Petit <titer@videolan.org>
Sun, 5 Jun 2005 10:17:10 +0000 (10:17 +0000)
committerEric Petit <titer@videolan.org>
Sun, 5 Jun 2005 10:17:10 +0000 (10:17 +0000)
 them, though)

git-svn-id: svn://svn.videolan.org/x264/trunk@250 df754926-b1dd-0310-bc7b-ec298dee348c

configure
encoder/encoder.c

index 7e899f7e472be1c9396a7e2c6e17d83a112e8620..e12ffaf97ef21ead1566f8c78271f2fd9dcf8444 100755 (executable)
--- 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"
index 6dcb6320963a314a7c1ca552f11d7978b87cb8cd..d997c3c94edfdc2575d207eafa4f42885faa1ec3 100644 (file)
 #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 <windows.h>
+#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 <pthread.h>
 #endif