Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
Build::compile_objects
when used in parallel
Before this commit, each call to `Build::compile_objects` release a raw token regardless of whether there is a token acquired by this process. As such, if `Build::compile_objects` is used in multithreading context, then it would call `Client::release_raw` for each thread and thus increasing the parallelism far beyond the limit. This commit fixed the bug by not acquiring the implicit global token when initializing global `jobserver::Client` and only obtain token when compiling objects. It also replaced use of `Option<jobserver::Client>` with `MaybeUninit<jobserver::Client>` and eliminate an `Option::unwrap()` inside fn `jobserver`. Signed-off-by: Jiahao XU <[email protected]>
- Loading branch information