foobar2000 SDK  2015-01-14
synchro_nix.cpp
Go to the documentation of this file.
1 #include "pfc.h"
2 
3 namespace pfc {
4 
5  void mutexBase::create( const pthread_mutexattr_t * attr ) {
6  if (pthread_mutex_init( &obj, attr) != 0) {
7  throw exception_bug_check();
8  }
9  }
11  pthread_mutex_destroy( &obj );
12  }
14  mutexAttr a; a.setRecursive(); create(&a.attr);
15  }
16  void mutexBase::create( const mutexAttr & a ) {
17  create( & a.attr );
18  }
19 
20  void readWriteLockBase::create( const pthread_rwlockattr_t * attr ) {
21  if (pthread_rwlock_init( &obj, attr) != 0) {
22  throw exception_bug_check();
23  }
24  }
26  create(&a.attr);
27  }
28 
29 }
pthread_mutexattr_t attr
Definition: synchro_nix.h:15
pthread_rwlock_t obj
Definition: synchro_nix.h:103
void create(const pthread_mutexattr_t *attr)
Definition: synchro_nix.cpp:5
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:20
void createRecur()
Definition: synchro_nix.cpp:13
pthread_rwlockattr_t attr
Definition: synchro_nix.h:83