From: Seungha Yang Date: Tue, 7 Jul 2020 20:15:28 +0000 (+0900) Subject: check: Use g_thread_yield instead of g_usleep(1) X-Git-Tag: 1.19.3~772 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4b6245597cbe4ba98e9a1a8a0aed162c177dbb4b;p=platform%2Fupstream%2Fgstreamer.git check: Use g_thread_yield instead of g_usleep(1) Since the commit https://gitlab.gnome.org/GNOME/glib/-/commit/01c02ac08b682de622930b1278c9c14d0ffe6c49, 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: --- diff --git a/libs/gst/check/gstcheck.h b/libs/gst/check/gstcheck.h index 45f7a58..9bb8ca3 100644 --- a/libs/gst/check/gstcheck.h +++ b/libs/gst/check/gstcheck.h @@ -622,8 +622,7 @@ G_STMT_START { \ #define THREAD_SWITCH() \ G_STMT_START { \ - /* a minimal sleep is a context switch */ \ - g_usleep (1); \ + g_thread_yield (); \ } G_STMT_END; #define THREAD_TEST_RUNNING() (!!_gst_check_threads_running)