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