10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
* the packaging of this file.
*
* Alternatively, it may be distributed under the terms of the GNU General
* Public License, either version 2 or 3, which can be found in the file
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#include <proto/exec.h>
bool
of_mutex_new(of_mutex_t *mutex)
{
InitSemaphore(mutex);
|
>
>
|
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
* the packaging of this file.
*
* Alternatively, it may be distributed under the terms of the GNU General
* Public License, either version 2 or 3, which can be found in the file
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#include <errno.h>
#include <proto/exec.h>
bool
of_mutex_new(of_mutex_t *mutex)
{
InitSemaphore(mutex);
|
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
return true;
}
bool
of_mutex_trylock(of_mutex_t *mutex)
{
return AttemptSemaphore(mutex);
}
bool
of_mutex_unlock(of_mutex_t *mutex)
{
ReleaseSemaphore(mutex);
|
|
>
>
>
>
>
|
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
return true;
}
bool
of_mutex_trylock(of_mutex_t *mutex)
{
if (!AttemptSemaphore(mutex)) {
errno = EBUSY;
return false;
}
return true;
}
bool
of_mutex_unlock(of_mutex_t *mutex)
{
ReleaseSemaphore(mutex);
|