Skip to content

fix(obs-c-oracle): keep the mingw pthread names around the pause lock probes - #4191

Merged
zackees merged 1 commit into
masterfrom
fix/4168-oracle-pause-mingw
Nov 9, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/4168-oracle-pause-mingw

Conversation

@vpacher

@vpacher vpacher commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Fixes #4168.

Problem

Since #4059 (9a95b46), every master Fast Gate fails in the Windows cross build of the C oracle:

rust/obs-c-oracle/oracle/output_pause_queries.c:41:9: error: 'pthread_mutex_lock' redefined [-Werror]
rust/obs-c-oracle/oracle/output_pause_queries.c:42:9: error: 'pthread_mutex_unlock' redefined [-Werror]

output_pause_queries.c counts the lock calls of obs-output-pause-queries.c.h by defining pthread_mutex_lock and pthread_mutex_unlock as its probes. The mingw build already defines both on the command line (-Dpthread_mutex_lock=oracle_pthread_mutex_lock, the w32-pthreads renaming).

Change

#pragma push_macro saves the two macros, #undef clears them for the probe defines, and #pragma pop_macro restores them after the include. The probes work on every host; the rest of the file keeps the renaming. GCC, Clang and MSVC support both pragmas.

Tests

A focused CI fix (coordination.md §4): RED and GREEN are local runs, in one commit.

The failing step is the rust-test lane's windows-gnu link check (ci/local_gate.py, lane_rust_test), which runs only in the full lane on master; a PR's Fast Gate runs only the touched crates' tests (test_diff), so #4059's own PR did not reach it. The same step, limited to the oracle crate, on a Linux host:

soldr cargo test -p obs-c-oracle --locked --no-run --target x86_64-pc-windows-gnu
  • RED, master 643866b: exit 101, output_pause_queries.c:41:9: error: 'pthread_mutex_lock' redefined [-Werror] and the same for pthread_mutex_unlock at 42:9, as in CI.
  • GREEN, f14f30f: exit 0.
  • Linux, f14f30f: soldr cargo test -p obs-data --test obs-tests-core output_pause_queries: 8 passed, including offset_is_read_between_matching_lock_and_unlock, which depends on the lock probes.
  • Tiers: test infrastructure only (the oracle); no product code, no new test.

🤖 Generated with Claude Code

… probes

Fixes #4168. Since #4059 every master Fast Gate fails in the Windows cross
build of the C oracle: output_pause_queries.c defines pthread_mutex_lock
and pthread_mutex_unlock as its lock probes, and the mingw build already
defines both on the command line (-Dpthread_mutex_lock=
oracle_pthread_mutex_lock, the w32-pthreads renaming), so -Werror stops
at "'pthread_mutex_lock' redefined".

Save the two macros with #pragma push_macro, undefine them for the
probes, and restore them with #pragma pop_macro after the include. The
probes work on every host, and the rest of the file keeps the renaming.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vpacher
vpacher requested a review from zackees as a code owner November 9, 2026 08:06
@vpacher
vpacher enabled auto-merge November 9, 2026 08:13
@vpacher
vpacher added this pull request to the merge queue Nov 9, 2026
@obs-rust-project-manager obs-rust-project-manager Bot moved this to In merge queue in obs-rust Multiview Nov 9, 2026
@zackees
zackees removed this pull request from the merge queue due to a manual request Nov 9, 2026
@zackees
zackees merged commit dd81c17 into master Nov 9, 2026
41 checks passed
@zackees
zackees deleted the fix/4168-oracle-pause-mingw branch November 9, 2026 18:08
@obs-rust-project-manager obs-rust-project-manager Bot moved this from In merge queue to Done in obs-rust Multiview Nov 9, 2026
@rdoupe rdoupe mentioned this pull request Nov 12, 2026
7 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

ci: master Fast Gate red since #4059: mingw oracle build, pthread_mutex_lock redefined

2 participants