summaryrefslogtreecommitdiff
path: root/src/xine-engine/xine.c
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2005-07-21 02:51:14 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2005-07-21 02:51:14 +0000
commit5643c9ba08abfca48787d49ae762dbbf504ded07 (patch)
tree9bd9eeb351431c5894eee75b5dcd7a73286798fa /src/xine-engine/xine.c
parent1977ccb219c5d8f914ed948e75ed62827f00da08 (diff)
downloadxine-lib-5643c9ba08abfca48787d49ae762dbbf504ded07.tar.gz
xine-lib-5643c9ba08abfca48787d49ae762dbbf504ded07.tar.bz2
- change frontend_lock and config_lock to recursive mutexes to fix
reentrancy problems (as reported by Reinhard Nissl and Darren Salt) - add a new recursive mutex support check to configure so we should fail nicely if system doesn't provides it (please test) CVS patchset: 7670 CVS date: 2005/07/21 02:51:14
Diffstat (limited to 'src/xine-engine/xine.c')
-rw-r--r--src/xine-engine/xine.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index 7a701cf22..40f8eb465 100644
--- a/src/xine-engine/xine.c
+++ b/src/xine-engine/xine.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine.c,v 1.313 2005/06/13 00:32:13 miguelfreitas Exp $
+ * $Id: xine.c,v 1.314 2005/07/21 02:51:14 miguelfreitas Exp $
*/
/*
@@ -459,6 +459,7 @@ xine_stream_t *xine_stream_new (xine_t *this,
xine_stream_t *stream;
int i;
+ pthread_mutexattr_t attr;
xprintf (this, XINE_VERBOSITY_DEBUG, "xine_stream_new\n");
@@ -523,7 +524,6 @@ xine_stream_t *xine_stream_new (xine_t *this,
pthread_mutex_init (&stream->info_mutex, NULL);
pthread_mutex_init (&stream->meta_mutex, NULL);
pthread_mutex_init (&stream->demux_lock, NULL);
- pthread_mutex_init (&stream->frontend_lock, NULL);
pthread_mutex_init (&stream->event_queues_lock, NULL);
pthread_mutex_init (&stream->counter_lock, NULL);
pthread_cond_init (&stream->counter_changed, NULL);
@@ -531,6 +531,13 @@ xine_stream_t *xine_stream_new (xine_t *this,
pthread_cond_init (&stream->first_frame_reached, NULL);
pthread_mutex_init (&stream->current_extra_info_lock, NULL);
+ /* warning: frontend_lock is a recursive mutex. it must NOT be
+ * used with neither pthread_cond_wait() or pthread_cond_timedwait()
+ */
+ pthread_mutexattr_init(&attr);
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+ pthread_mutex_init (&stream->frontend_lock, &attr);
+
/*
* Clear meta/stream info
*/