![]()  | 
  
    VCV Rack API v2
    
   | 
 
Allows multiple "reader" threads to obtain a lock simultaneously, but only one "writer" thread. More...
#include <mutex.hpp>
Public Member Functions | |
| SharedMutex () | |
| ~SharedMutex () | |
| void | lock () | 
| bool | try_lock () | 
| Returns whether the lock was acquired.   | |
| void | unlock () | 
| void | lock_shared () | 
| bool | try_lock_shared () | 
| Returns whether the lock was acquired.   | |
| void | unlock_shared () | 
Public Attributes | |
| pthread_rwlock_t | rwlock | 
Allows multiple "reader" threads to obtain a lock simultaneously, but only one "writer" thread.
This implementation is currently just a wrapper for pthreads, which works on Linux/Mac/. This is available in C++17 as std::shared_mutex, but unfortunately we're using C++11.
Locking should be avoided in real-time audio threads.
      
  | 
  inline | 
      
  | 
  inline | 
      
  | 
  inline | 
      
  | 
  inline | 
Returns whether the lock was acquired.
      
  | 
  inline | 
      
  | 
  inline | 
      
  | 
  inline | 
Returns whether the lock was acquired.
      
  | 
  inline | 
| pthread_rwlock_t rack::SharedMutex::rwlock |