Changes in kernel/generic/src/synch/futex.c [4774a32:98000fb] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/synch/futex.c
r4774a32 r98000fb 90 90 /** Initialize kernel futex structure. 91 91 * 92 * @param futex 92 * @param futex Kernel futex structure. 93 93 */ 94 94 void futex_initialize(futex_t *futex) … … 102 102 /** Sleep in futex wait queue. 103 103 * 104 * @param uaddr Userspace address of the futex counter. 105 * 106 * @return If there is no physical mapping for uaddr ENOENT is 107 * returned. Otherwise returns a wait result as defined in 108 * synch.h. 109 */ 110 unative_t sys_futex_sleep(uintptr_t uaddr) 104 * @param uaddr Userspace address of the futex counter. 105 * @param usec If non-zero, number of microseconds this thread is willing to 106 * sleep. 107 * @param flags Select mode of operation. 108 * 109 * @return One of ESYNCH_TIMEOUT, ESYNCH_OK_ATOMIC and ESYNCH_OK_BLOCKED. See 110 * synch.h. If there is no physical mapping for uaddr ENOENT is returned. 111 */ 112 unative_t sys_futex_sleep_timeout(uintptr_t uaddr, uint32_t usec, int flags) 111 113 { 112 114 futex_t *futex; … … 138 140 udebug_stoppable_begin(); 139 141 #endif 140 rc = waitq_sleep_timeout(&futex->wq, 0, SYNCH_FLAGS_INTERRUPTIBLE); 142 rc = waitq_sleep_timeout(&futex->wq, usec, flags | 143 SYNCH_FLAGS_INTERRUPTIBLE); 144 141 145 #ifdef CONFIG_UDEBUG 142 146 udebug_stoppable_end(); … … 147 151 /** Wakeup one thread waiting in futex wait queue. 148 152 * 149 * @param uaddr 150 * 151 * @return 153 * @param uaddr Userspace address of the futex counter. 154 * 155 * @return ENOENT if there is no physical mapping for uaddr. 152 156 */ 153 157 unative_t sys_futex_wakeup(uintptr_t uaddr) … … 186 190 * If the structure does not exist already, a new one is created. 187 191 * 188 * @param paddr 189 * 190 * @return 192 * @param paddr Physical address of the userspace futex counter. 193 * 194 * @return Address of the kernel futex structure. 191 195 */ 192 196 futex_t *futex_find(uintptr_t paddr) … … 280 284 /** Compute hash index into futex hash table. 281 285 * 282 * @param key Address where the key (i.e. physical address of futex283 * counter) isstored.284 * 285 * @return 286 * @param key Address where the key (i.e. physical address of futex counter) is 287 * stored. 288 * 289 * @return Index into futex hash table. 286 290 */ 287 291 size_t futex_ht_hash(unative_t *key) … … 292 296 /** Compare futex hash table item with a key. 293 297 * 294 * @param key Address where the key (i.e. physical address of futex295 * counter) isstored.296 * 297 * @return 298 * @param key Address where the key (i.e. physical address of futex counter) is 299 * stored. 300 * 301 * @return True if the item matches the key. False otherwise. 298 302 */ 299 303 bool futex_ht_compare(unative_t *key, size_t keys, link_t *item) … … 309 313 /** Callback for removal items from futex hash table. 310 314 * 311 * @param item 315 * @param item Item removed from the hash table. 312 316 */ 313 317 void futex_ht_remove_callback(link_t *item)
Note:
See TracChangeset
for help on using the changeset viewer.