Skip to content
  • Philip Withnall's avatar
    tests: Remove a potential race from test-thread · 441f0b22
    Philip Withnall authored and Olivier Crête's avatar Olivier Crête committed
    A g_usleep() was introduced in commit
    e22ecb19 to fix a potential race where
    the non-main threads would finish all their work before the error_loop
    was started, leaving the error_loop to run for 30s then abort the test.
    
    A better fix, instead of doing a racy sleep, is to have the non-main
    threads spin until the error_loop is running. GLib takes care of all the
    locking for us, and since we don’t care about efficiency for test cases,
    spinning is fine (the wait is also going to be quite short).
    441f0b22