mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 00:14:11 +09:00
Merge pull request #11929 from mfleisz/fix-pollset-yield
[winpr,synch] Yield after a poll timeout in emscripten
This commit is contained in:
@@ -7,6 +7,10 @@
|
||||
#include <winpr/assert.h>
|
||||
#include "../log.h"
|
||||
|
||||
#if defined(__EMSCRIPTEN__)
|
||||
#include <emscripten.h>
|
||||
#endif
|
||||
|
||||
#define TAG WINPR_TAG("sync.pollset")
|
||||
|
||||
#ifdef WINPR_HAVE_POLL_H
|
||||
@@ -142,7 +146,14 @@ int pollset_poll(WINPR_POLL_SET* set, DWORD dwMilliseconds)
|
||||
|
||||
ret = poll(set->pollset, set->fillIndex, timeout);
|
||||
if (ret >= 0)
|
||||
{
|
||||
#if defined(__EMSCRIPTEN__)
|
||||
/* Yield in emscripten so event handlers can be processed */
|
||||
if (ret == 0)
|
||||
emscripten_sleep(0);
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (errno != EINTR)
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user