Changes in uspace/lib/c/generic/private/futex.h [f787c8e:205f1add] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/private/futex.h
rf787c8e r205f1add 102 102 * 103 103 */ 104 static inline errno_t futex_down_composable(futex_t *futex, const struct timeval *expires) 104 static inline errno_t futex_down_composable(futex_t *futex, 105 const struct timespec *expires) 105 106 { 106 107 // TODO: Add tests for this. … … 109 110 return EOK; 110 111 111 suseconds_t timeout;112 usec_t timeout; 112 113 113 114 if (!expires) { … … 119 120 timeout = 1; 120 121 } else { 121 struct time valtv;122 struct timespec tv; 122 123 getuptime(&tv); 123 timeout = t v_gteq(&tv, expires) ? 1 :124 tv_sub_diff(expires, &tv);124 timeout = ts_gteq(&tv, expires) ? 1 : 125 NSEC2USEC(ts_sub_diff(expires, &tv)); 125 126 } 126 127 … … 148 149 } 149 150 150 static inline errno_t futex_down_timeout(futex_t *futex, const struct timeval *expires) 151 { 152 if (expires && expires->tv_sec == 0 && expires->tv_usec == 0) { 151 static inline errno_t futex_down_timeout(futex_t *futex, 152 const struct timespec *expires) 153 { 154 if (expires && expires->tv_sec == 0 && expires->tv_nsec == 0) { 153 155 /* Nonblocking down. */ 154 156 … … 209 211 * trydown. 210 212 */ 211 struct time val tv = { .tv_sec = 0, .tv_usec = 0 };213 struct timespec tv = { .tv_sec = 0, .tv_nsec = 0 }; 212 214 return futex_down_timeout(futex, &tv) == EOK; 213 215 }
Note:
See TracChangeset
for help on using the changeset viewer.