Differences From Artifact [953df43013]:
- File
src/condition_pthread.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: 1460) [annotate] [blame] [check-ins using]
To Artifact [1c18f916fb]:
- File
src/condition_pthread.m
— part of check-in
[e702135e17]
at
2019-09-01 16:53:45
on branch trunk
— Remove remaining uses of lrint()
It was used to convert a time interval into seconds and microseconds or
seconds and nanoseconds and introduced inaccuracies. (user: js, size: 1434) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
11 12 13 14 15 16 17 | * * 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. */ | < < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | * * 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_condition_new(of_condition_t *condition) { return (pthread_cond_init(condition, NULL) == 0); } bool |
︙ | ︙ | |||
44 45 46 47 48 49 50 | bool of_condition_timed_wait(of_condition_t *condition, of_mutex_t *mutex, of_time_interval_t timeout) { struct timespec ts; ts.tv_sec = (time_t)timeout; | | | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | bool of_condition_timed_wait(of_condition_t *condition, of_mutex_t *mutex, of_time_interval_t timeout) { struct timespec ts; ts.tv_sec = (time_t)timeout; ts.tv_nsec = (timeout - ts.tv_sec) * 1000000000; return (pthread_cond_timedwait(condition, mutex, &ts) == 0); } bool of_condition_free(of_condition_t *condition) { return (pthread_cond_destroy(condition) == 0); } |