Differences From Artifact [01cabee958]:
- File
src/mutex_winapi.m
— 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: 1447) [annotate] [blame] [check-ins using]
To Artifact [83475077c0]:
- File src/mutex_winapi.m — part of check-in [d7fd999fee] at 2019-09-01 12:50:08 on branch trunk — {condition,mutex,thread}.m: Set errno on error (user: js, size: 1518) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | * * 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. */ bool of_mutex_new(of_mutex_t *mutex) { InitializeCriticalSection(mutex); return true; } bool of_mutex_lock(of_mutex_t *mutex) { EnterCriticalSection(mutex); return true; } bool of_mutex_trylock(of_mutex_t *mutex) { | > > | > > > > > | 11 12 13 14 15 16 17 18 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 | * * 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> bool of_mutex_new(of_mutex_t *mutex) { InitializeCriticalSection(mutex); return true; } bool of_mutex_lock(of_mutex_t *mutex) { EnterCriticalSection(mutex); return true; } bool of_mutex_trylock(of_mutex_t *mutex) { if (!TryEnterCriticalSection(mutex)) { errno = EBUSY; return false; } return true; } bool of_mutex_unlock(of_mutex_t *mutex) { LeaveCriticalSection(mutex); |
︙ | ︙ |