diff options
author | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2005-06-13 00:32:11 +0000 |
---|---|---|
committer | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2005-06-13 00:32:11 +0000 |
commit | 110a7c280bf9feffe7df9ca765287eb31395dd5a (patch) | |
tree | 7df2b734c13caf31e3168159902eb4dae7303149 /src/xine-engine/xine.c | |
parent | 5eaa2ba0f9f67f65e4f80c1a25f41f561c98b5d9 (diff) | |
download | xine-lib-110a7c280bf9feffe7df9ca765287eb31395dd5a.tar.gz xine-lib-110a7c280bf9feffe7df9ca765287eb31395dd5a.tar.bz2 |
**BUGFIX**
fix deadlock with _x_flush_events_queues
CVS patchset: 7621
CVS date: 2005/06/13 00:32:11
Diffstat (limited to 'src/xine-engine/xine.c')
-rw-r--r-- | src/xine-engine/xine.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index f9639e89e..7a701cf22 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.312 2005/03/06 11:08:40 tmattern Exp $ + * $Id: xine.c,v 1.313 2005/06/13 00:32:13 miguelfreitas Exp $ */ /* @@ -624,7 +624,12 @@ void _x_flush_events_queues (xine_stream_t *stream) { pthread_mutex_lock (&queue->lock); pthread_mutex_unlock (&stream->event_queues_lock); - if (queue->listener_thread != NULL) { + /* we might have been called from the very same function that + * processes events, therefore waiting here would cause deadlock. + * check only queues with listener threads which are not + * currently executing their callback functions. + */ + if (queue->listener_thread != NULL && !queue->callback_running) { while (!xine_list_is_empty (queue->events)) { pthread_cond_wait (&queue->events_processed, &queue->lock); } |