Philip Withnall 0eadf651fb tests: Rewrite thread-pool test for freeing queued items
The previous test was racy: it assumed that not all queued thread pool
jobs would start to be executed before `g_thread_pool_free()` was
called, whereas actually on some systems (particularly BSD ones), they
would all start (or even finish) being executed, and hence the free
function might never be called.

Rewrite the test to:
 • Synchronise the test function and worker thread functions more
   closely.
 • Not bother about ordering the shared and exclusive variants of the
   test differently. That seems to be a hangover from another test
   above.
 • Limit the number of worker threads to 1, rather than 2, since this
   makes the test easier to control.

This has been tested with `--repeat 10000` on Linux, and it succeeds all
of those runs whereas previously it failed quite reliably.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #2456
2021-08-19 14:25:24 +01:00
..
2021-01-05 21:42:59 +01:00
2017-05-24 11:58:19 +02:00
2017-05-24 11:58:19 +02:00
2019-05-27 17:51:40 +00:00
2017-05-24 11:58:19 +02:00
2017-05-24 11:58:19 +02:00
2020-06-23 10:49:44 +01:00
2017-05-24 11:58:19 +02:00
2021-07-29 10:09:27 -04:00
2017-05-24 11:58:19 +02:00
2021-05-28 17:15:46 +02:00
2021-05-28 17:15:46 +02:00
2017-05-24 11:58:19 +02:00
2017-05-24 11:58:19 +02:00
2017-05-24 11:58:19 +02:00
2017-05-24 11:58:19 +02:00
2017-05-24 11:58:19 +02:00
2017-05-24 11:58:19 +02:00
2021-08-02 15:55:08 +01:00
2020-11-17 15:50:07 +00:00
2018-01-04 22:19:30 +01:00
2019-11-25 13:09:25 +01:00
2017-05-24 11:58:19 +02:00
2021-07-24 11:26:40 -04:00
2017-05-24 11:58:19 +02:00
2017-05-24 11:58:19 +02:00
2019-03-15 21:30:22 +01:00
2017-05-24 11:58:19 +02:00
2017-05-24 11:58:19 +02:00
2017-05-24 11:58:19 +02:00
2017-05-24 11:58:19 +02:00
2017-05-24 11:58:19 +02:00
2021-07-21 13:49:48 +02:00
2017-05-24 11:58:19 +02:00
2017-05-24 11:58:19 +02:00
2019-11-25 13:09:25 +01:00
2019-09-18 10:47:23 +02:00
2021-08-16 20:58:53 +01:00
2017-05-24 11:58:19 +02:00
2021-05-13 22:16:27 +01:00
2020-05-12 12:41:22 +01:00
2021-03-23 11:36:57 +00:00
2021-03-23 11:36:57 +00:00
2017-05-24 11:58:19 +02:00
2021-07-29 10:09:27 -04:00
2017-05-24 11:58:19 +02:00
2021-08-02 14:52:06 +01:00
2017-05-24 11:58:19 +02:00
2017-05-24 11:58:19 +02:00
2021-06-08 08:38:59 +00:00