| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
#ifndef H_FREAC_LOCKING |
| 14 |
#define H_FREAC_LOCKING |
| 15 |
|
| 16 |
#include <smooth.h> |
| 17 |
#include <boca.h> |
| 18 |
|
| 19 |
using namespace smooth; |
| 20 |
|
| 21 |
namespace freac |
| 22 |
{ |
| 23 |
class Locking |
| 24 |
{ |
| 25 |
private: |
| 26 |
static Int allocatedThreads; |
| 27 |
|
| 28 |
static Array<Bool> deviceLocked; |
| 29 |
static Array<Bool> outputLocked; |
| 30 |
|
| 31 |
static Threads::Mutex managementMutex; |
| 32 |
public: |
| 33 |
static Bool AllocateThread(); |
| 34 |
static Bool FreeThread(); |
| 35 |
|
| 36 |
static Bool LockDeviceForTrack(const BoCA::Track &); |
| 37 |
static Bool UnlockDeviceForTrack(const BoCA::Track &); |
| 38 |
|
| 39 |
static Bool LockOutputForTrack(const BoCA::Track &); |
| 40 |
static Bool UnlockOutputForTrack(const BoCA::Track &); |
| 41 |
}; |
| 42 |
}; |
| 43 |
|
| 44 |
#endif |