diff options
author | Philip Withnall <philip.withnall@collabora.co.uk> | 2015-09-30 17:44:44 +0100 |
---|---|---|
committer | Philip Withnall <philip.withnall@collabora.co.uk> | 2015-10-01 09:21:00 +0100 |
commit | 9f10231fc787e4683e896bf35f086906a5b16c03 (patch) | |
tree | c09dc39aa5f7e4b4a5ffa3ebef95ea1f5b98e9d7 /tests/test-new-dribble.c | |
parent | dac3e280d6f3fd792f1d79313debd03c0df282c4 (diff) | |
download | libnice-9f10231fc787e4683e896bf35f086906a5b16c03.tar.gz |
tests: Remove g_thread_init() calls
We depend on GLib 2.36.0; g_thread_init() has been deprecated since
2.32.0, when thread initialisation was changed to happen automatically.
Reviewed-by: Olivier CrĂȘte <olivier.crete@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D297
Diffstat (limited to 'tests/test-new-dribble.c')
-rw-r--r-- | tests/test-new-dribble.c | 35 |
1 files changed, 8 insertions, 27 deletions
diff --git a/tests/test-new-dribble.c b/tests/test-new-dribble.c index 32f9013..22064e5 100644 --- a/tests/test-new-dribble.c +++ b/tests/test-new-dribble.c @@ -56,21 +56,14 @@ #define LEFT_AGENT GINT_TO_POINTER(1) #define RIGHT_AGENT GINT_TO_POINTER(2) -#if !GLIB_CHECK_VERSION(2,31,8) - static GMutex *stun_mutex_ptr = NULL; - static GCond *stun_signal_ptr = NULL; - static GMutex *stun_thread_mutex_ptr = NULL; - static GCond *stun_thread_signal_ptr = NULL -#else - static GMutex stun_mutex; - static GMutex *stun_mutex_ptr = &stun_mutex; - static GCond stun_signal; - static GCond *stun_signal_ptr = &stun_signal; - static GMutex stun_thread_mutex; - static GMutex *stun_thread_mutex_ptr = &stun_thread_mutex; - static GCond stun_thread_signal; - static GCond *stun_thread_signal_ptr = &stun_thread_signal; -#endif +static GMutex stun_mutex; +static GMutex *stun_mutex_ptr = &stun_mutex; +static GCond stun_signal; +static GCond *stun_signal_ptr = &stun_signal; +static GMutex stun_thread_mutex; +static GMutex *stun_thread_mutex_ptr = &stun_thread_mutex; +static GCond stun_thread_signal; +static GCond *stun_thread_signal_ptr = &stun_thread_signal; static NiceComponentState global_lagent_state = NICE_COMPONENT_STATE_LAST; static NiceComponentState global_ragent_state = NICE_COMPONENT_STATE_LAST; @@ -737,16 +730,8 @@ int main(void) } -#if !GLIB_CHECK_VERSION(2,31,8) - g_thread_init (NULL); - stun_thread = g_thread_create (stun_thread_func, GINT_TO_POINTER (sock), - TRUE, NULL); - stun_mutex_ptr = g_mutex_new (); - stun_signal_ptr = g_cond_new (); -#else stun_thread = g_thread_new ("listen for STUN requests", stun_thread_func, GINT_TO_POINTER (sock)); -#endif // Once the the thread is forked, we want to listen for a signal // that the socket was opened successfully @@ -801,10 +786,6 @@ int main(void) g_object_unref (ragent); g_thread_join (stun_thread); -#if !GLIB_CHECK_VERSION(2,31,8) - g_mutex_free (stun_mutex_ptr); - g_cond_free (stun_signal_ptr); -#endif g_object_unref (global_cancellable); g_source_destroy (src); |