summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreddyg <[email protected]>2008-10-06 21:36:01 +0000
committereddyg <[email protected]>2008-10-06 21:36:01 +0000
commit71febc94826583e61194ad98ff91ace2dc2366cf (patch)
tree00c91297d607c514858ba32d801e9b720ad3a49a
parentc1fa8a9521bb2401ffd9a1d09afaed7f436216af (diff)
Change pthread mutex's to be explicitly NORMAL instead of relying on the default on a per OS basis. Cygwin was using RECURSIVE as a default, which does not block the caller upon a second lock. This commit fixes decomb, and slow, and slower deinterlace on Windows.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1817 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--libhb/ports.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libhb/ports.c b/libhb/ports.c
index cecfc562e..9d5fd08b4 100644
--- a/libhb/ports.c
+++ b/libhb/ports.c
@@ -409,7 +409,12 @@ hb_lock_t * hb_lock_init()
#if defined( SYS_BEOS )
l->sem = create_sem( 1, "sem" );
#elif USE_PTHREAD
- pthread_mutex_init( &l->mutex, NULL );
+ pthread_mutexattr_t mta;
+
+ pthread_mutexattr_init(&mta);
+ pthread_mutexattr_settype(&mta, PTHREAD_MUTEX_NORMAL);
+
+ pthread_mutex_init( &l->mutex, &mta );
//#elif defined( SYS_CYGWIN )
// l->mutex = CreateMutex( 0, FALSE, 0 );
#endif