From e85db920bb31a699b38c057f51a3eb68bb1b719d Mon Sep 17 00:00:00 2001 From: Eric Petit Date: Sun, 29 May 2005 20:27:09 +0000 Subject: [PATCH] Fixed multithreading on BeOS (pthread emulation required) git-svn-id: svn://svn.videolan.org/x264/trunk@241 df754926-b1dd-0310-bc7b-ec298dee348c --- configure | 11 ++++++++--- encoder/encoder.c | 7 +++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 357ad36b..f90b2d2d 100755 --- 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" diff --git a/encoder/encoder.c b/encoder/encoder.c index 149023cd..82d54240 100644 --- a/encoder/encoder.c +++ b/encoder/encoder.c @@ -27,8 +27,15 @@ #include #if HAVE_PTHREAD +#ifdef SYS_BEOS +#include +#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 #endif +#endif #include "common/common.h" #include "common/cpu.h" -- 2.40.0