[PATCH v3 0/9] MR272: d3dx10: Add D3DX10CreateThreadPump implementation.
Piotr Caban (@piotr)
wine at gitlab.winehq.org
Sun Jun 26 09:02:13 CDT 2022
On Tue Jun 21 18:07:44 2022 +0000, **** wrote:
> Zebediah Figura replied on the mailing list:
> ```
> On 6/18/22 14:21, Piotr Caban wrote:
> > +static DWORD WINAPI io_thread(void *arg)
> > +{
> > + struct thread_pump *thread_pump = arg;
> > + struct work_item *work_item;
> > + UINT zero = 0;
> > + HRESULT hr;
> > +
> > + TRACE("%p thread started.\n", thread_pump);
> > +
> > + while (1)
> > + {
> > + RtlWaitOnAddress((void *)&thread_pump->io_count, &zero,
> sizeof(zero), NULL);
> > + AcquireSRWLockExclusive(&thread_pump->io_lock);
> > + if (!thread_pump->io_count)
> > + {
> > + ReleaseSRWLockExclusive(&thread_pump->io_lock);
> > + continue;
> > + }
> This works, but it strikes me as simpler (and more idiomatic) just to
> use a condition variable. Any reason not to do that?
> Note also that "zero" can be static const.
> ```
I'll change the code to use condition variables.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/272#note_2718
More information about the wine-devel
mailing list