Make CTL definitions less ambiguous

This commit is contained in:
Justine Tunney 2024-07-01 03:48:28 -07:00
parent 239f8ce76e
commit acbabedf27
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
30 changed files with 176 additions and 173 deletions

View file

@ -11,17 +11,20 @@ class mutex
public:
mutex()
{
pthread_mutex_init(&m_, nullptr);
if (pthread_mutex_init(&m_, nullptr))
__builtin_trap();
}
~mutex()
{
pthread_mutex_destroy(&m_);
if (pthread_mutex_destroy(&m_))
__builtin_trap();
}
void lock()
{
pthread_mutex_lock(&m_);
if (pthread_mutex_lock(&m_))
__builtin_trap();
}
bool try_lock()
@ -31,7 +34,8 @@ class mutex
void unlock()
{
pthread_mutex_unlock(&m_);
if (pthread_mutex_unlock(&m_))
__builtin_trap();
}
// Delete copy constructor and assignment operator