Log In
New Account
Home My Page Projects Blender 2.x BF release
Summary Activity Tracker SCM Files

Patches: Browse

[#31240] Fix audaspace deadlock

Date:
2012-05-02 16:53
Priority:
3
State:
Closed
Submitted by:
Wander Lairson Costa (walac)
Assigned to:
Joerg Mueller (nexyon)
Category:
Game engine
Group:
None
Resolution(Old, use status):
None
Resolution:
Applied
Patch for:
 
Summary:
Fix audaspace deadlock
Detailed 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

Followup

Message
  • Date: 2012-05-05 01:38
  • Sender: Joerg Mueller
  • 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).
  • Date: 2012-05-07 15:20
  • Sender: Wander Lairson Costa
  • 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.
  • Date: 2012-06-20 16:26
  • Sender: Wander Lairson Costa
  • Any possibility of this patch going into release 2.64?
  • Date: 2012-06-20 16:27
  • Sender: Wander Lairson Costa
  • Ignore my last message, I posted it in the wrong patch topic...
 

Attached Files:

Name Date Download
audaspace-deadlock.patch 2012-05-02 16:53 Download

Changes:

Field Old Value Date By
ResolutionOpen2012-05-05 01:38nexyon
status_idOpen2012-05-05 01:38nexyon
close_dateNone2012-05-05 01:38nexyon
assigned_tonone2012-05-05 01:38nexyon
File Added20459: audaspace-deadlock.patch2012-05-02 16:53walac