foobar2000 SDK  2015-08-03
synchro_nix.cpp
Go to the documentation of this file.
1 #include "pfc.h"
2 
3 #ifndef _WIN32
4 
5 namespace pfc {
6 
7  void mutexBase::create( const pthread_mutexattr_t * attr ) {
8  if (pthread_mutex_init( &obj, attr) != 0) {
9  throw exception_bug_check();
10  }
11  }
13  pthread_mutex_destroy( &obj );
14  }
16  mutexAttr a; a.setRecursive(); create(&a.attr);
17  }
18  void mutexBase::create( const mutexAttr & a ) {
19  create( & a.attr );
20  }
21 
22  void readWriteLockBase::create( const pthread_rwlockattr_t * attr ) {
23  if (pthread_rwlock_init( &obj, attr) != 0) {
24  throw exception_bug_check();
25  }
26  }
28  create(&a.attr);
29  }
30 
31 }
32 
33 #endif // _WIN32
pthread_mutexattr_t attr
Definition: synchro_nix.h:15
void create(const pthread_mutexattr_t *attr)
Definition: synchro_nix.cpp:7
pthread_mutex_t obj
Definition: synchro_nix.h:36
void setRecursive()
Definition: synchro_nix.h:10
void create(const pthread_rwlockattr_t *attr)
Definition: synchro_nix.cpp:22
void createRecur()
Definition: synchro_nix.cpp:15
pthread_rwlockattr_t attr
Definition: synchro_nix.h:83