Differences From Artifact [c8d24f47bf]:
- File src/platform/amiga/mutex.m — part of check-in [109db78ecd] at 2020-02-29 14:49:23 on branch trunk — Move platform specific files into a subdirectory (user: js, size: 1526) [annotate] [blame] [check-ins using] [more...]
To Artifact [53f62a4365]:
- File
src/platform/amiga/mutex.m
— part of check-in
[5b37fbeb82]
at
2020-12-20 21:26:08
on branch trunk
— Return error instead of using errno for threading
errno is problematic for Amiga libraries and is also not thread-safe on
some systems, even though it should. (user: js, size: 1479) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
19 20 21 22 23 24 25 | #include <errno.h> #import "mutex.h" #include <proto/exec.h> | < > | < > | < > | < | | < | < > | < > | < > < > < > < > < > | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | #include <errno.h> #import "mutex.h" #include <proto/exec.h> int of_mutex_new(of_mutex_t *mutex) { InitSemaphore(mutex); return 0; } int of_mutex_lock(of_mutex_t *mutex) { ObtainSemaphore(mutex); return 0; } int of_mutex_trylock(of_mutex_t *mutex) { if (!AttemptSemaphore(mutex)) return EBUSY; return 0; } int of_mutex_unlock(of_mutex_t *mutex) { ReleaseSemaphore(mutex); return 0; } int of_mutex_free(of_mutex_t *mutex) { return 0; } int of_rmutex_new(of_rmutex_t *rmutex) { return of_mutex_new(rmutex); } int of_rmutex_lock(of_rmutex_t *rmutex) { return of_mutex_lock(rmutex); } int of_rmutex_trylock(of_rmutex_t *rmutex) { return of_mutex_trylock(rmutex); } int of_rmutex_unlock(of_rmutex_t *rmutex) { return of_mutex_unlock(rmutex); } int of_rmutex_free(of_rmutex_t *rmutex) { return of_mutex_free(rmutex); } |