[nas] libaudio deadlock (was: Re: NAS or Solaris deadlock...)

Tobias Diedrich td at informatik.uni-hannover.de
Fri Feb 15 12:09:59 MST 2002


Tobias Diedrich wrote:

> On a related note, my nas output plugin for mplayer does not like the
> new thread-safe libaudio. I have not investigated much, but I assume it
> deadlocks because one thread is waiting in AuNextEvent (maybe this grabs
> the lock ?) and the other tries writeBuffer, which never returns
> (because the lock is grabbed by AuNextEvent ? But no events will happen
> until I write something...).

This should fix it, I hope it's ok to unlock there, maybe it rather has
to be done within _AuReadEvents...

--- nas-1.5/lib/audio/NextEvent.c.orig	Fri Feb 15 20:05:22 2002
+++ nas-1.5/lib/audio/NextEvent.c	Fri Feb 15 20:03:32 2002
@@ -55,8 +55,11 @@
 	
 	_AuLockServer();
 	
-	if (aud->head == NULL)		/* block until event arrives */
+	if (aud->head == NULL) {	/* block until event arrives */
+	    _AuUnlockServer();
 	    _AuReadEvents(aud);
+	    _AuLockServer();
+	}
 	qelt = aud->head;
 	*event = qelt->event;
 

-- 
Tobias Diedrich							PGP: 0x9AC7E0BC



More information about the Nas mailing list