mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-07 13:30:03 -05:00
poll: don't use shared event in Windows pa_poll()
We call pa_poll concurrently from multiple threads, so we cannot have an event object that is reused.
This commit is contained in:
parent
fe346caded
commit
7776a42be4
1 changed files with 4 additions and 3 deletions
|
|
@ -377,7 +377,7 @@ pa_poll (struct pollfd *pfd, nfds_t nfd, int timeout)
|
||||||
# endif /* OPEN_MAX -- else, no check is needed */
|
# endif /* OPEN_MAX -- else, no check is needed */
|
||||||
# endif /* !_SC_OPEN_MAX */
|
# endif /* !_SC_OPEN_MAX */
|
||||||
#else /* WINDOWS_NATIVE*/
|
#else /* WINDOWS_NATIVE*/
|
||||||
static HANDLE hEvent;
|
HANDLE hEvent;
|
||||||
WSANETWORKEVENTS ev;
|
WSANETWORKEVENTS ev;
|
||||||
HANDLE h, handle_array[FD_SETSIZE + 2];
|
HANDLE h, handle_array[FD_SETSIZE + 2];
|
||||||
DWORD ret, wait_timeout, nhandles;
|
DWORD ret, wait_timeout, nhandles;
|
||||||
|
|
@ -477,8 +477,7 @@ pa_poll (struct pollfd *pfd, nfds_t nfd, int timeout)
|
||||||
return rc;
|
return rc;
|
||||||
#else
|
#else
|
||||||
|
|
||||||
if (!hEvent)
|
hEvent = CreateEvent (NULL, FALSE, FALSE, NULL);
|
||||||
hEvent = CreateEvent (NULL, FALSE, FALSE, NULL);
|
|
||||||
|
|
||||||
restart:
|
restart:
|
||||||
handle_array[0] = hEvent;
|
handle_array[0] = hEvent;
|
||||||
|
|
@ -639,6 +638,8 @@ restart:
|
||||||
goto restart;
|
goto restart;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CloseHandle(hEvent);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue