forked from bevyengine/bevy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add thread create/destroy callbacks to TaskPool (bevyengine#6561)
# Objective Fix bevyengine#1991. Allow users to have a bit more control over the creation and finalization of the threads in `TaskPool`. ## Solution Add new methods to `TaskPoolBuilder` that expose callbacks that are called to initialize and finalize each thread in the `TaskPool`. Unlike the proposed solution in bevyengine#1991, the callback is argument-less. If an an identifier is needed, `std::thread::current` should provide that information easily. Added a unit test to ensure that they're being called correctly.
- Loading branch information
Showing
1 changed file
with
98 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters