feat: support libuv finalization before task_manager #14202
Open
algebraic-dev wants to merge 16 commits into
Open
feat: support libuv finalization before task_manager #14202algebraic-dev wants to merge 16 commits into
algebraic-dev wants to merge 16 commits into
Conversation
|
Mathlib CI status (docs):
|
Collaborator
|
Reference manual CI status:
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes the finalization of the LibUV thread.
The finalization of the libuv thread occours in
object.cppinside thelean_finalize_task_managerimmediately before theg_task_managerbeing deleted. We need that because we need this exact order and thefinalizefunction runs after the manager is deleted.Now
event_loop_lockreturns a boolean that says if the loop is closing or not and it's used like that:We have two cond variables, one for waiting for new requests within the libuv loop and other one to the finalization process, so some finalizers can wait the finalization of the loop to close and free resources.