Commit 9f10231f authored by Philip Withnall's avatar Philip Withnall

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: default avatarOlivier Crête <olivier.crete@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D297
parent dac3e280
...@@ -54,7 +54,6 @@ main (void) ...@@ -54,7 +54,6 @@ main (void)
WSAStartup(0x0202, &w); WSAStartup(0x0202, &w);
#endif #endif
nice_address_init (&addr); nice_address_init (&addr);
g_thread_init (NULL);
if (!nice_address_set_from_string (&addr, "127.0.0.1")) if (!nice_address_set_from_string (&addr, "127.0.0.1"))
g_assert_not_reached (); g_assert_not_reached ();
......
...@@ -440,7 +440,6 @@ main (void) ...@@ -440,7 +440,6 @@ main (void)
WSAStartup (0x0202, &w); WSAStartup (0x0202, &w);
#endif #endif
nice_address_init (&addr); nice_address_init (&addr);
g_thread_init (NULL);
g_assert (nice_address_set_from_string (&addr, "127.0.0.1")); g_assert (nice_address_set_from_string (&addr, "127.0.0.1"));
......
...@@ -172,7 +172,6 @@ int main (void) ...@@ -172,7 +172,6 @@ int main (void)
WSADATA w; WSADATA w;
WSAStartup(0x0202, &w); WSAStartup(0x0202, &w);
#endif #endif
g_thread_init (NULL);
loop = g_main_loop_new (NULL, FALSE); loop = g_main_loop_new (NULL, FALSE);
......
...@@ -215,8 +215,6 @@ int main (void) ...@@ -215,8 +215,6 @@ int main (void)
WSAStartup(0x0202, &w); WSAStartup(0x0202, &w);
#endif #endif
g_thread_init (NULL);
global_mainloop = g_main_loop_new (NULL, FALSE); global_mainloop = g_main_loop_new (NULL, FALSE);
/* step: create the agents L and R */ /* step: create the agents L and R */
......
...@@ -491,7 +491,6 @@ int main (void) ...@@ -491,7 +491,6 @@ int main (void)
WSAStartup(0x0202, &w); WSAStartup(0x0202, &w);
#endif #endif
g_thread_init (NULL);
global_mainloop = g_main_loop_new (NULL, FALSE); global_mainloop = g_main_loop_new (NULL, FALSE);
......
...@@ -834,7 +834,6 @@ int main (void) ...@@ -834,7 +834,6 @@ int main (void)
WSAStartup(0x0202, &w); WSAStartup(0x0202, &w);
#endif #endif
g_thread_init(NULL);
global_mainloop = g_main_loop_new (NULL, FALSE); global_mainloop = g_main_loop_new (NULL, FALSE);
......
...@@ -397,9 +397,6 @@ int main (void) ...@@ -397,9 +397,6 @@ int main (void)
WSAStartup(0x0202, &w); WSAStartup(0x0202, &w);
#endif #endif
#if !GLIB_CHECK_VERSION(2,31,8)
g_thread_init(NULL);
#endif
global_mainloop = g_main_loop_new (NULL, FALSE); global_mainloop = g_main_loop_new (NULL, FALSE);
......
...@@ -112,7 +112,6 @@ int main (void) ...@@ -112,7 +112,6 @@ int main (void)
WSADATA w; WSADATA w;
WSAStartup (0x0202, &w); WSAStartup (0x0202, &w);
#endif #endif
g_thread_init (NULL);
l_data.cancellable = g_cancellable_new (); l_data.cancellable = g_cancellable_new ();
l_data.blocking = FALSE; l_data.blocking = FALSE;
......
...@@ -127,7 +127,6 @@ int main (void) ...@@ -127,7 +127,6 @@ int main (void)
WSADATA w; WSADATA w;
WSAStartup (0x0202, &w); WSAStartup (0x0202, &w);
#endif #endif
g_thread_init (NULL);
run_io_stream_test (30, TRUE, &callbacks, (gpointer) TRUE, NULL, NULL, NULL); run_io_stream_test (30, TRUE, &callbacks, (gpointer) TRUE, NULL, NULL, NULL);
......
...@@ -127,7 +127,6 @@ int main (void) ...@@ -127,7 +127,6 @@ int main (void)
WSADATA w; WSADATA w;
WSAStartup (0x0202, &w); WSAStartup (0x0202, &w);
#endif #endif
g_thread_init (NULL);
run_io_stream_test (30, TRUE, &callbacks, (gpointer) TRUE, NULL, NULL, NULL); run_io_stream_test (30, TRUE, &callbacks, (gpointer) TRUE, NULL, NULL, NULL);
......
...@@ -159,7 +159,6 @@ int main (void) ...@@ -159,7 +159,6 @@ int main (void)
WSADATA w; WSADATA w;
WSAStartup (0x0202, &w); WSAStartup (0x0202, &w);
#endif #endif
g_thread_init (NULL);
l_data = g_malloc0 (sizeof (ThreadData)); l_data = g_malloc0 (sizeof (ThreadData));
r_data = g_malloc0 (sizeof (ThreadData)); r_data = g_malloc0 (sizeof (ThreadData));
......
...@@ -124,7 +124,6 @@ int main (void) ...@@ -124,7 +124,6 @@ int main (void)
WSADATA w; WSADATA w;
WSAStartup (0x0202, &w); WSAStartup (0x0202, &w);
#endif #endif
g_thread_init (NULL);
l_data = g_malloc0 (sizeof (ThreadData)); l_data = g_malloc0 (sizeof (ThreadData));
r_data = g_malloc0 (sizeof (ThreadData)); r_data = g_malloc0 (sizeof (ThreadData));
......
...@@ -72,7 +72,6 @@ main (void) ...@@ -72,7 +72,6 @@ main (void)
guint stream; guint stream;
nice_address_init (&addr); nice_address_init (&addr);
g_thread_init(NULL);
loop = g_main_loop_new (NULL, FALSE); loop = g_main_loop_new (NULL, FALSE);
......
...@@ -56,21 +56,14 @@ ...@@ -56,21 +56,14 @@
#define LEFT_AGENT GINT_TO_POINTER(1) #define LEFT_AGENT GINT_TO_POINTER(1)
#define RIGHT_AGENT GINT_TO_POINTER(2) #define RIGHT_AGENT GINT_TO_POINTER(2)
#if !GLIB_CHECK_VERSION(2,31,8) static GMutex stun_mutex;
static GMutex *stun_mutex_ptr = NULL; static GMutex *stun_mutex_ptr = &stun_mutex;
static GCond *stun_signal_ptr = NULL; static GCond stun_signal;
static GMutex *stun_thread_mutex_ptr = NULL; static GCond *stun_signal_ptr = &stun_signal;
static GCond *stun_thread_signal_ptr = NULL static GMutex stun_thread_mutex;
#else static GMutex *stun_thread_mutex_ptr = &stun_thread_mutex;
static GMutex stun_mutex; static GCond stun_thread_signal;
static GMutex *stun_mutex_ptr = &stun_mutex; static GCond *stun_thread_signal_ptr = &stun_thread_signal;
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 NiceComponentState global_lagent_state = NICE_COMPONENT_STATE_LAST; static NiceComponentState global_lagent_state = NICE_COMPONENT_STATE_LAST;
static NiceComponentState global_ragent_state = NICE_COMPONENT_STATE_LAST; static NiceComponentState global_ragent_state = NICE_COMPONENT_STATE_LAST;
...@@ -737,16 +730,8 @@ int main(void) ...@@ -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 = g_thread_new ("listen for STUN requests",
stun_thread_func, GINT_TO_POINTER (sock)); stun_thread_func, GINT_TO_POINTER (sock));
#endif
// Once the the thread is forked, we want to listen for a signal // Once the the thread is forked, we want to listen for a signal
// that the socket was opened successfully // that the socket was opened successfully
...@@ -801,10 +786,6 @@ int main(void) ...@@ -801,10 +786,6 @@ int main(void)
g_object_unref (ragent); g_object_unref (ragent);
g_thread_join (stun_thread); 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_object_unref (global_cancellable);
g_source_destroy (src); g_source_destroy (src);
......
...@@ -400,7 +400,6 @@ int main (void) ...@@ -400,7 +400,6 @@ int main (void)
WSAStartup(0x0202, &w); WSAStartup(0x0202, &w);
#endif #endif
g_thread_init(NULL);
global_mainloop = g_main_loop_new (NULL, FALSE); global_mainloop = g_main_loop_new (NULL, FALSE);
......
...@@ -1202,7 +1202,6 @@ main (int argc, char *argv[]) ...@@ -1202,7 +1202,6 @@ main (int argc, char *argv[])
WSADATA w; WSADATA w;
WSAStartup (0x0202, &w); WSAStartup (0x0202, &w);
#endif #endif
g_thread_init (NULL);
if (!long_mode) { if (!long_mode) {
/* Quick mode. Just test each of the stream APIs in reliable and /* Quick mode. Just test each of the stream APIs in reliable and
......
...@@ -211,7 +211,6 @@ int main (void) ...@@ -211,7 +211,6 @@ int main (void)
WSADATA w; WSADATA w;
WSAStartup(0x0202, &w); WSAStartup(0x0202, &w);
#endif #endif
g_thread_init(NULL);
lmainctx = g_main_context_new (); lmainctx = g_main_context_new ();
rmainctx = g_main_context_new (); rmainctx = g_main_context_new ();
......
...@@ -76,8 +76,6 @@ main (void) ...@@ -76,8 +76,6 @@ main (void)
nice_address_init (&addr_local); nice_address_init (&addr_local);
nice_address_init (&addr_remote); nice_address_init (&addr_remote);
g_thread_init(NULL);
g_assert (nice_address_set_from_string (&addr_local, "127.0.0.1")); g_assert (nice_address_set_from_string (&addr_local, "127.0.0.1"));
g_assert (nice_address_set_from_string (&addr_remote, "127.0.0.1")); g_assert (nice_address_set_from_string (&addr_remote, "127.0.0.1"));
nice_address_set_port (&addr_remote, 2345); nice_address_set_port (&addr_remote, 2345);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment