Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] remove destructor in mutex #40

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

skalenji
Copy link

Mutex destructor is used to as a fail safe to release locks in case process is terminated unexpectedly, this is not really needed and could lead to errors
* The actual lock provider responsible for releasing the lock could be destructed before the mutex, during shutdown there is no guarantee in order of which objects are destructed
* All lock providers extend the LockAbstaract class which already has a destructor responsible for freeing locks in case of failure
* Throwig exception in the destructor is not a good idea, doing so triggers a fatal error

  Mutex destructor is used to as a fail safe to release locks in case process is terminated unexpectedly, this is not really needed and could lead to errors
    * The actual lock provider responsible for releasing the lock could be destructed before the mutex, during shutdown there is no guarantee in order of which objects are destructed
    * All lock providers extend the LockAbstaract class which already has a destructor responsible for freeing locks in case of failure
    * Throwig exception in the destructor is not a good idea, doing so triggers a fatal error
@gpressutto5
Copy link

@arvenil can you check this please?

@gpressutto5
Copy link

@skalenji You need to remove the destructor on NinjaMutex\Lock\LockAbstract too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants