rust-lang / cc-rs

Rust library for build scripts to compile C/C++ code into a Rust library
https://docs.rs/cc
Apache License 2.0
1.77k stars 427 forks source link

Optimize jobserver `try_acquire` #1037

Closed NobodyXu closed 2 months ago

NobodyXu commented 2 months ago

First try jobserver::Client::try_acquire (available on jobserver 1.0.29), which will work:

if not, we will simply fallback to help thread implementation, spawning one thread to maintain compatibility with other platforms.

workingjubilee commented 2 months ago

I do not believe it is acceptable to vendor OnceLock. It is a bad idea for a low-maintenance crate to vendor code that may need a security update.

NobodyXu commented 2 months ago

I do not believe it is acceptable to vendor OnceLock. It is a bad idea for a low-maintenance crate to vendor code that may need a security update.

Thanks for pointing out, under @the8472 's advice, I've replaced that with once_cell dependency and removed the vendoring of OnceLock.