]> git.sesse.net Git - x264/commitdiff
Fixed multithreading on BeOS (pthread emulation required)
authorEric Petit <titer@videolan.org>
Sun, 29 May 2005 20:27:09 +0000 (20:27 +0000)
committerEric Petit <titer@videolan.org>
Sun, 29 May 2005 20:27:09 +0000 (20:27 +0000)
git-svn-id: svn://svn.videolan.org/x264/trunk@241 df754926-b1dd-0310-bc7b-ec298dee348c

configure
encoder/encoder.c

index 357ad36b1db8a4587bd39536098dfb3a6984387e..f90b2d2d8703c1f545e3ad62efb7d83c53c19156 100755 (executable)
--- a/configure
+++ b/configure
@@ -132,11 +132,16 @@ for opt do
         --enable-pthread)
             CFLAGS="$CFLAGS -DHAVE_PTHREAD=1"
             pthread="yes"
-            if [ $SYS = MINGW ]; then
+            case $SYS in
+              MINGW)
                 LDFLAGS="$LDFLAGS -lpthreadGC2"
-            else
+                ;;
+              BEOS)
+                ;;
+              *)
                 LDFLAGS="$LDFLAGS -lpthread"
-            fi
+                ;;
+            esac
             ;;
         --enable-debug)
             CFLAGS="$CFLAGS -g"
index 149023cde258a65df5eeb5a01ab266718b398753..82d54240f26d8afac8f37231ffe5fdffcdad4c10 100644 (file)
 #include <math.h>
 
 #if HAVE_PTHREAD
+#ifdef SYS_BEOS
+#include <kernel/OS.h>
+#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)
+#else
 #include <pthread.h>
 #endif
+#endif
 
 #include "common/common.h"
 #include "common/cpu.h"