Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • G GLib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 858
    • Issues 858
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 56
    • Merge requests 56
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • GLib
  • Merge requests
  • !2228

tests: Rewrite thread-pool test for freeing queued items

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Philip Withnall requested to merge pwithnall/glib:2456-thread-pool-fix into main Aug 19, 2021
  • Overview 2
  • Commits 2
  • Pipelines 1
  • Changes 2

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 (closed)

Closes #2456 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: 2456-thread-pool-fix