Differences From Artifact [44aab7ac4a]:
- File
src/mutex.h
— part of check-in
[5358e9ea6a]
at
2019-08-01 20:14:35
on branch trunk
— Split threading.[hm] into multiple files
This allows the runtime to only link against the parts it needs, without
pulling in unnecessary parts like thread spawning, TLS and conditions. (user: js, size: 3754) [annotate] [blame] [check-ins using]
To Artifact [1c81973578]:
- File src/mutex.h — part of check-in [c26426e80f] at 2019-08-01 21:05:49 on branch trunk — Add missing extern "C" (user: js, size: 3821) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | #else typedef struct { of_mutex_t mutex; of_tlskey_t count; } of_rmutex_t; #endif extern bool of_mutex_new(of_mutex_t *mutex); extern bool of_mutex_lock(of_mutex_t *mutex); extern bool of_mutex_trylock(of_mutex_t *mutex); extern bool of_mutex_unlock(of_mutex_t *mutex); extern bool of_mutex_free(of_mutex_t *mutex); extern bool of_rmutex_new(of_rmutex_t *rmutex); extern bool of_rmutex_lock(of_rmutex_t *rmutex); extern bool of_rmutex_trylock(of_rmutex_t *rmutex); extern bool of_rmutex_unlock(of_rmutex_t *rmutex); extern bool of_rmutex_free(of_rmutex_t *rmutex); /* Spinlocks are inlined for performance. */ static OF_INLINE void of_thread_yield(void) { #if defined(OF_HAVE_SCHED_YIELD) | > > > > > > | 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 | #else typedef struct { of_mutex_t mutex; of_tlskey_t count; } of_rmutex_t; #endif #ifdef __cplusplus extern "C" { #endif extern bool of_mutex_new(of_mutex_t *mutex); extern bool of_mutex_lock(of_mutex_t *mutex); extern bool of_mutex_trylock(of_mutex_t *mutex); extern bool of_mutex_unlock(of_mutex_t *mutex); extern bool of_mutex_free(of_mutex_t *mutex); extern bool of_rmutex_new(of_rmutex_t *rmutex); extern bool of_rmutex_lock(of_rmutex_t *rmutex); extern bool of_rmutex_trylock(of_rmutex_t *rmutex); extern bool of_rmutex_unlock(of_rmutex_t *rmutex); extern bool of_rmutex_free(of_rmutex_t *rmutex); #ifdef __cplusplus } #endif /* Spinlocks are inlined for performance. */ static OF_INLINE void of_thread_yield(void) { #if defined(OF_HAVE_SCHED_YIELD) |
︙ | ︙ |