Skip to content

fix(sync): Destroy condition variables - #2004

Merged
jpnurmi merged 3 commits into
masterfrom
jpnurmi/fix/condvar-free
Aug 20, 2026
Merged

fix(sync): Destroy condition variables#2004
jpnurmi merged 3 commits into
masterfrom
jpnurmi/fix/condvar-free

Conversation

@jpnurmi

@jpnurmi jpnurmi commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Add cross-platform condition-variable cleanup and invoke it when thread pools, background workers, flush tasks, and app-hang monitors are released.

Condition variables may own implementation-specific resources, and POSIX requires destroying an initialized condition variable before reinitializing it. Close the semaphore and event handles owned by the pre-Vista emulation.

Update synchronization tests to clean up their condition variables. Keep the task-queue notification under its predicate mutex so teardown cannot race with an in-flight signal.

Add cross-platform condition-variable cleanup and invoke it when thread
pools, background workers, flush tasks, and app-hang monitors are released.

Condition variables may own implementation-specific resources, and POSIX
requires destroying an initialized condition variable before reinitializing it.
Close the semaphore and event handles owned by the pre-Vista emulation.

Update synchronization tests to clean up their condition variables. Keep the
task-queue notification under its predicate mutex so teardown cannot race with
an in-flight signal.
Comment thread tests/unit/test_sync.c
@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 74.42%. Comparing base (85b229c) to head (17fce54).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2004      +/-   ##
==========================================
+ Coverage   74.41%   74.42%   +0.01%     
==========================================
  Files         104      104              
  Lines       25913    25922       +9     
  Branches     4691     4691              
==========================================
+ Hits        19282    19293      +11     
+ Misses       5299     5298       -1     
+ Partials     1332     1331       -1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
@jpnurmi
jpnurmi merged commit fb337fb into master Aug 20, 2026
67 checks passed
@jpnurmi
jpnurmi deleted the jpnurmi/fix/condvar-free branch August 20, 2026 10:14
mertefesensoy added a commit to mertefesensoy/sentry-native that referenced this pull request Aug 20, 2026
Brings in fb337fb (getsentry#2004). The only conflict was CHANGELOG.md, where
both getsentry#2004 and this branch appended an entry to the same Unreleased
"Fixes" list; both entries are kept, with getsentry#2004 first since it is
already on master.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants