Skip to content

Commit

Permalink
fix compilation on emscripten (#1917)
Browse files Browse the repository at this point in the history
  • Loading branch information
usamoi authored Oct 14, 2024
1 parent f4d7074 commit 9938e0d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pgrx-pg-sys/src/submodules/thread_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ fn init_active_thread(tid: NonZeroUsize) {
panic!("Attempt to initialize `pgrx` active thread from a thread other than the main");
}
match ACTIVE_THREAD.compare_exchange(0, tid.get(), Ordering::Relaxed, Ordering::Relaxed) {
#[cfg(not(target_os = "windows"))]
#[cfg(all(target_family = "unix", not(target_os = "emscripten")))]
Ok(_) => unsafe {
// We won the race. Register an atfork handler to clear the atomic
// in any child processes we spawn.
Expand All @@ -103,7 +103,7 @@ fn init_active_thread(tid: NonZeroUsize) {
}
libc::pthread_atfork(None, None, Some(clear_in_child));
},
#[cfg(target_os = "windows")]
#[allow(unreachable_patterns)]
Ok(_) => (),
Err(_) => {
thread_id_check_failed();
Expand Down

0 comments on commit 9938e0d

Please sign in to comment.