What is causing this deadlock?
What is causing this deadlock?
- Subject: What is causing this deadlock?
- From: Bob Stuller <email@hidden>
- Date: Fri, 25 Jan 2008 14:28:33 -0500
Folks, Greetings!
A co-worker moved some code onto a separate thread. Doing so took
some of our audio input code off the main thread as well, something
that I would have thought was okay. But I was wrong.
Every so often the problem arises right after we've taken hog mode
successfully. You can see in the stack of the work thread:
AudioDeviceSetProperty >> HALObject::SetPropertyData >>
HALPlugIn::ObjectSetPropertyData >>
IOA_SingleDevice::SetPropertyData >> HP_HogMode::Take >>
IOA_SingleDevice::HogModeStateChanged >> CAMutex::Lock >>
pthread_mutex_lock >> semaphore_wait_signal_trap
Over on the main thread, you see the following in the stack:
CFRunLoopRunSpecific >> __CFMachPortPerform >>
IOA_HWDevice::MachPortCallBack >>
IOA_SingleDevice::HWDevice_FormatChanged >> CAMutex::Lock >>
pthread_mutex_lock >> semaphore_wait_signal_trap
Some questions that occurred to me, partially based on conjecture:
Why is the IOA_SingleDevice notifying itself? Why is Hog mode being
notified as a format change? Is the same CAMutex instance used in
both IOA_SingleDevice methods? What am I doing wrong?
Peace,
Bob
--
Chop wood, carry water.
- zen saying
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden