mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-27 06:26:15 +01:00
contexts test: don't use deprecated GCond wait API
This commit is contained in:
parent
3d93c44374
commit
b264fccd23
@ -70,18 +70,17 @@ test_thread_independence (void)
|
|||||||
static gboolean
|
static gboolean
|
||||||
idle_start_test1_thread (gpointer loop)
|
idle_start_test1_thread (gpointer loop)
|
||||||
{
|
{
|
||||||
GTimeVal time;
|
gint64 time;
|
||||||
GThread *thread;
|
GThread *thread;
|
||||||
gboolean io_completed;
|
gboolean io_completed;
|
||||||
|
|
||||||
g_mutex_lock (&test1_mutex);
|
g_mutex_lock (&test1_mutex);
|
||||||
thread = g_thread_new ("test1", test1_thread, NULL);
|
thread = g_thread_new ("test1", test1_thread, NULL);
|
||||||
|
|
||||||
g_get_current_time (&time);
|
time = g_get_monotonic_time () + 2 * G_TIME_SPAN_SECOND;
|
||||||
time.tv_sec += 2;
|
|
||||||
while (!test1_done)
|
while (!test1_done)
|
||||||
{
|
{
|
||||||
io_completed = g_cond_timed_wait (&test1_cond, &test1_mutex, &time);
|
io_completed = g_cond_wait_until (&test1_cond, &test1_mutex, time);
|
||||||
g_assert (io_completed);
|
g_assert (io_completed);
|
||||||
}
|
}
|
||||||
g_thread_join (thread);
|
g_thread_join (thread);
|
||||||
|
Loading…
Reference in New Issue
Block a user