projects
/
platform
/
upstream
/
glib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3d93c44
)
contexts test: don't use deprecated GCond wait API
author
Ryan Lortie
<desrt@desrt.ca>
Mon, 17 Oct 2011 01:10:23 +0000
(21:10 -0400)
committer
Ryan Lortie
<desrt@desrt.ca>
Mon, 17 Oct 2011 01:41:15 +0000
(21:41 -0400)
gio/tests/contexts.c
patch
|
blob
|
history
diff --git
a/gio/tests/contexts.c
b/gio/tests/contexts.c
index
de00464
..
4501631
100644
(file)
--- a/
gio/tests/contexts.c
+++ b/
gio/tests/contexts.c
@@
-70,18
+70,17
@@
test_thread_independence (void)
static gboolean
idle_start_test1_thread (gpointer loop)
{
static gboolean
idle_start_test1_thread (gpointer loop)
{
-
GTimeVal
time;
+
gint64
time;
GThread *thread;
gboolean io_completed;
g_mutex_lock (&test1_mutex);
thread = g_thread_new ("test1", test1_thread, NULL);
GThread *thread;
gboolean io_completed;
g_mutex_lock (&test1_mutex);
thread = g_thread_new ("test1", test1_thread, NULL);
- g_get_current_time (&time);
- time.tv_sec += 2;
+ time = g_get_monotonic_time () + 2 * G_TIME_SPAN_SECOND;
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_thread_join (thread);
g_assert (io_completed);
}
g_thread_join (thread);