mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 03:31:05 +00:00
check: Use g_thread_yield instead of g_usleep(1)
Since the commit
01c02ac08b
,
g_usleep(1) will be translated to Sleep(1) on Windows which means
sleep in 1 millisecond. But GLib provides g_thread_yield() API
which is exactly what we required here for thread context switching.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/644>
This commit is contained in:
parent
1baa2ba9f0
commit
95c8d8e4b5
1 changed files with 1 additions and 2 deletions
|
@ -610,8 +610,7 @@ G_STMT_START { \
|
||||||
|
|
||||||
#define THREAD_SWITCH() \
|
#define THREAD_SWITCH() \
|
||||||
G_STMT_START { \
|
G_STMT_START { \
|
||||||
/* a minimal sleep is a context switch */ \
|
g_thread_yield (); \
|
||||||
g_usleep (1); \
|
|
||||||
} G_STMT_END;
|
} G_STMT_END;
|
||||||
|
|
||||||
#define THREAD_TEST_RUNNING() (!!_gst_check_threads_running)
|
#define THREAD_TEST_RUNNING() (!!_gst_check_threads_running)
|
||||||
|
|
Loading…
Reference in a new issue