2 |
* * |
* * |
3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003 by Benno Senoner and Christian Schoenebeck * |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
6 |
* * |
* * |
7 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
8 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
40 |
pthread_mutex_lock(&__posix_mutex); |
pthread_mutex_lock(&__posix_mutex); |
41 |
} |
} |
42 |
|
|
43 |
|
bool Mutex::Trylock() { |
44 |
|
if (pthread_mutex_trylock(&__posix_mutex) == EBUSY) |
45 |
|
return false; |
46 |
|
return true; |
47 |
|
} |
48 |
|
|
49 |
void Mutex::Unlock() { |
void Mutex::Unlock() { |
50 |
pthread_mutex_unlock(&__posix_mutex); |
pthread_mutex_unlock(&__posix_mutex); |
51 |
} |
} |