Permalink
Browse files

Fixed deadlock when starting LiveTV through myth://

libcmyth now uses a recursive mutex to allow the thread holding the connection lock to get passed another lock.
  • Loading branch information...
David Teirney
David Teirney committed May 29, 2011
1 parent 85f5169 commit b2738b7785c4f045896342f217eafe2610c51d9f
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/cmyth/libcmyth/connection.c
@@ -43,7 +43,7 @@
#include <signal.h>
#include <cmyth_local.h>
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
typedef struct {
int version;

8 comments on commit b2738b7

@Fneufneu

This comment has been minimized.

Show comment
Hide comment
@Fneufneu

Fneufneu May 29, 2011

Member

i just want to warn you about PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP portability.
it does not exist on FreeBSD.

Member

Fneufneu replied May 29, 2011

i just want to warn you about PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP portability.
it does not exist on FreeBSD.

@davilla

This comment has been minimized.

Show comment
Hide comment
@davilla

davilla May 29, 2011

Contributor

yes, it also effects osx/ios.

Contributor

davilla replied May 29, 2011

yes, it also effects osx/ios.

@dteirney

This comment has been minimized.

Show comment
Hide comment
@dteirney

dteirney May 29, 2011

Member

Is there a recursive mutex on those platforms that can be used?

Member

dteirney replied May 29, 2011

Is there a recursive mutex on those platforms that can be used?

@dteirney

This comment has been minimized.

Show comment
Hide comment
@dteirney

dteirney May 29, 2011

Member

Can someone with FreeBSD / OSX check if PTHREAD_RECURSIVE_MUTEX_INITIALIZER exists. If so either I can change tonight after work or could you change directly. Presumable the _NP means non-portable?

Member

dteirney replied May 29, 2011

Can someone with FreeBSD / OSX check if PTHREAD_RECURSIVE_MUTEX_INITIALIZER exists. If so either I can change tonight after work or could you change directly. Presumable the _NP means non-portable?

@davilla

This comment has been minimized.

Show comment
Hide comment
@davilla

davilla May 29, 2011

Contributor

see xbmc/threads/XBMC_mutex.cpp

Contributor

davilla replied May 29, 2011

see xbmc/threads/XBMC_mutex.cpp

@dteirney

This comment has been minimized.

Show comment
Hide comment
@dteirney

dteirney May 29, 2011

Member

Thanks Davilla. There seems to be a spelling mistake in the first if def section in XBMC_mutex.cpp. XBCM_PTHREAD_MUTEX_RECURSIVE != XBMC_PTHREAD_MUTEX_RECURSIVE

Member

dteirney replied May 29, 2011

Thanks Davilla. There seems to be a spelling mistake in the first if def section in XBMC_mutex.cpp. XBCM_PTHREAD_MUTEX_RECURSIVE != XBMC_PTHREAD_MUTEX_RECURSIVE

@davilla

This comment has been minimized.

Show comment
Hide comment
@davilla

davilla May 29, 2011

Contributor

haha, noted

Contributor

davilla replied May 29, 2011

haha, noted

@davilla

This comment has been minimized.

Show comment
Hide comment
@davilla

davilla May 29, 2011

Contributor

http://lists.apple.com/archives/unix-porting/2002/Sep/msg00079.html

neither PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP nor PTHREAD_RECURSIVE_MUTEX_INITIALIZER exists on osx and I also suspect any bsd base system.

Contributor

davilla replied May 29, 2011

http://lists.apple.com/archives/unix-porting/2002/Sep/msg00079.html

neither PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP nor PTHREAD_RECURSIVE_MUTEX_INITIALIZER exists on osx and I also suspect any bsd base system.

Please sign in to comment.