Changeset bd41ac52 in mainline for uspace/lib/c/generic/private
- Timestamp:
- 2018-08-25T22:21:25Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cca80a2
- Parents:
- e2625b1a
- Location:
- uspace/lib/c/generic/private
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/private/async.h
re2625b1a rbd41ac52 40 40 #include <fibril.h> 41 41 #include <fibril_synch.h> 42 #include < sys/time.h>42 #include <time.h> 43 43 #include <stdbool.h> 44 44 -
uspace/lib/c/generic/private/fibril.h
re2625b1a rbd41ac52 81 81 82 82 extern void fibril_wait_for(fibril_event_t *); 83 extern errno_t fibril_wait_timeout(fibril_event_t *, const struct time val*);83 extern errno_t fibril_wait_timeout(fibril_event_t *, const struct timespec *); 84 84 extern void fibril_notify(fibril_event_t *); 85 85 86 extern errno_t fibril_ipc_wait(ipc_call_t *, const struct time val*);86 extern errno_t fibril_ipc_wait(ipc_call_t *, const struct timespec *); 87 87 extern void fibril_ipc_poke(void); 88 88 -
uspace/lib/c/generic/private/futex.h
re2625b1a rbd41ac52 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 } -
uspace/lib/c/generic/private/thread.h
re2625b1a rbd41ac52 49 49 extern void thread_detach(thread_id_t); 50 50 extern thread_id_t thread_get_id(void); 51 extern int thread_usleep(useconds_t);52 extern unsigned int thread_sleep(unsigned int);51 extern void thread_usleep(usec_t); 52 extern void thread_sleep(sec_t); 53 53 54 54 #endif
Note:
See TracChangeset
for help on using the changeset viewer.