[PATCH 2/3] winecoreaudio: Implement the lock-free callback design.

Joerg-Cyril.Hoehle at t-systems.com Joerg-Cyril.Hoehle at t-systems.com
Mon Jan 30 04:37:17 CST 2012


Hi,

with that in place, I've been runing thousands of test iterations without a failure.
Fixes bug #29657

We now maintain queued_buffers in addition to avail_buffers.  Every
API entry point that matters must call avail_update that, like
its ALSA counterpart, updates the running state.
The API is very small, so that's an easy job.

Later, the separate AQBufinfo for the sake of GetPosition should
be merged into the other ones.  There's no reason to have 3 queues.

>void CALLBACK ca_period_cb(void *user, BOOLEAN timer)
>-    OSSpinLockLock(&This->lock);
>     if(This->event)
>         SetEvent(This->event);
>-    OSSpinLockUnlock(&This->lock);
This is not an OS callback, but there's no need to protect
- "This", because DeleteTimerQueue's event
  guarantees that it lives long enough;
- This->event, because my tests show that it can be
  set once exactly.
I'll write a patch to enforce that in SetEventHandle another day.

So I also added WT_EXECUTEINTIMERTHREAD for that SetEvent callback
in a hope that this exhibits less overhead, making for a more stable time base.

I've not yet written the patch #4 to turn all OSSpinLock into EnterCS.

Regards,
	Jörg Höhle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-winecoreaudio-Implement-the-lock-free-callback-desig.patch
Type: application/octet-stream
Size: 14833 bytes
Desc: 0002-winecoreaudio-Implement-the-lock-free-callback-desig.patch
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20120130/9f94243a/attachment-0001.obj>


More information about the wine-patches mailing list