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

✨ Add RecursiveMutex class & make Mutex/RecursiveMutex ctors constexpr #677

Open
wants to merge 5 commits into
base: develop-pros-4
Choose a base branch
from

Conversation

ion098
Copy link

@ion098 ion098 commented Jun 7, 2024

Summary:

Adds a RecursiveMutex class, and make the constructors for Mutex/RecursiveMutex constexpr.

Motivation:

There is currently no C++ API for recursive mutexes, which prevents using std::lock_guard with recursive mutexes. Making the constructors constexpr allows mutex variables to be declared as constinit.

Test Plan:

  • Check that it compiles.
  • Check that the mutex only allows one thread to lock it.
  • Check that the same thread can lock the RecursiveMutex multiple times.

@ion098 ion098 changed the title Add RecursiveMutex class ✨ Add RecursiveMutex class Jun 7, 2024
@Rocky14683
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ion098 ion098 changed the title ✨ Add RecursiveMutex class ✨ Add RecursiveMutex class & make Mutex/RecursiveMutex ctors constexpr Jun 20, 2024
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.

2 participants