Commit 243610bc authored by Fabrice Bellet's avatar Fabrice Bellet Committed by Olivier Crête

tests: fix io-stream when built with optimizations

In construct like "while (foo);" when foo is modified outside of the
current thread, the variable should be declared volatile to suggest the
compiler to read its value without making code optimization.
parent 7ea00f61
......@@ -500,7 +500,7 @@ run_io_stream_test (guint deadlock_timeout, gboolean reliable,
* This must only be called from the read thread implementation. */
check_for_termination (TestIOStreamThreadData *data, gsize *recv_count,
gsize *other_recv_count, gsize *send_count, gsize expected_recv_count)
gsize *other_recv_count, volatile gsize *send_count, gsize expected_recv_count)
guint stream_id;
gpointer tmp;
......@@ -102,6 +102,6 @@ void run_io_stream_test (guint deadlock_timeout, gboolean reliable,
gpointer l_user_data, GDestroyNotify l_user_data_free,
gpointer r_user_data, GDestroyNotify r_user_data_free);
void check_for_termination (TestIOStreamThreadData *data, gsize *recv_count,
gsize *other_recv_count, gsize *send_count, gsize expected_recv_count);
gsize *other_recv_count, volatile gsize *send_count, gsize expected_recv_count);
void stop_main_loop (GMainLoop *loop);
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