Home

Fix audaspace deadlock
Closed, ResolvedPublic

Description
Commit 46036 introduced a deadlock in audaspace. It happens when leaving audaspace, the OpenALDevice destructor waits for the AUD_openalRunThread thread to exit, but it maybe inside AUD_Reference code. Since OpenALDevice object is inside a AUD_Reference, and now AUD_Reference holds a mutex, we have a deadlock here. This patch tries to solve the problem.

Thanks,
Wander Lairson Costa
nexyon (Joerg Mueller) added a comment.Via Old WorldMay 5 2012, 1:38 AM
Applied, however: this makes the code non-threadsafe again, I'll have a look at replacing AUD_Reference by shared_ptr at some point in the future, removing that necessity to be able to create shared pointers out of a pointer which is already shared elsewhere (that works with AUD_Reference but not with shared_ptr).
nexyon (Joerg Mueller) closed this task as "Resolved".Via Old WorldMay 5 2012, 1:38 AM
walac (Wander Lairson Costa) added a comment.Via Old WorldMay 7 2012, 3:20 PM
Thanks.

I have a drafted an implementation of AUD_Reference based on shared_ptr (of course I will have to update the patch to reflect latest changes in AUD_Reference.h), I can shared it if you are interested.
walac (Wander Lairson Costa) added a comment.Via Old WorldMay 8 2012, 8:07 PM
I submitted a new patch [1] which implements AUD_Reference using boost::shared_ptr.

[1] http://projects.blender.org/tracker/index.php?func=detail&aid=31372&group_id=9&atid=127
walac (Wander Lairson Costa) added a comment.Via Old WorldJun 20 2012, 4:26 PM
Any possibility of this patch going into release 2.64?
walac (Wander Lairson Costa) added a comment.Via Old WorldJun 20 2012, 4:27 PM
Ignore my last message, I posted it in the wrong patch topic...

Add Comment