Changeset 96c30c8 in mainline
- Timestamp:
- 2018-06-28T15:45:37Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 331d024
- Parents:
- 82453b29
- git-author:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-06-28 15:36:29)
- git-committer:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-06-28 15:45:37)
- Location:
- kernel/generic
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/synch/waitq.h
r82453b29 r96c30c8 82 82 extern void _waitq_wakeup_unsafe(waitq_t *, wakeup_mode_t); 83 83 extern void waitq_interrupt_sleep(struct thread *); 84 extern void waitq_unsleep(waitq_t *);85 84 extern int waitq_count_get(waitq_t *); 86 85 extern void waitq_count_set(waitq_t *, int val); -
kernel/generic/src/ipc/ipc.c
r82453b29 r96c30c8 550 550 errno_t rc; 551 551 552 restart:553 552 rc = waitq_sleep_timeout(&box->wq, usec, flags, NULL); 554 553 if (rc != EOK) … … 590 589 list_append(&request->ab_link, &box->dispatched_calls); 591 590 } else { 592 /* This can happen regularly after ipc_cleanup */ 591 /* 592 * This can happen regularly after ipc_cleanup, or in 593 * response to ipc_poke(). Let the caller sort out the wakeup. 594 */ 593 595 irq_spinlock_unlock(&box->lock, true); 594 goto restart;596 return NULL; 595 597 } 596 598 -
kernel/generic/src/ipc/sysipc.c
r82453b29 r96c30c8 856 856 sys_errno_t sys_ipc_poke(void) 857 857 { 858 waitq_ unsleep(&TASK->answerbox.wq);858 waitq_wakeup(&TASK->answerbox.wq, WAKEUP_FIRST); 859 859 return EOK; 860 860 } -
kernel/generic/src/synch/waitq.c
r82453b29 r96c30c8 190 190 if (do_wakeup) 191 191 thread_ready(thread); 192 }193 194 /** Interrupt the first thread sleeping in the wait queue.195 *196 * Note that the caller somehow needs to know that the thread to be interrupted197 * is sleeping interruptibly.198 *199 * @param wq Pointer to wait queue.200 *201 */202 void waitq_unsleep(waitq_t *wq)203 {204 irq_spinlock_lock(&wq->lock, true);205 206 if (!list_empty(&wq->sleepers)) {207 thread_t *thread = list_get_instance(list_first(&wq->sleepers),208 thread_t, wq_link);209 210 irq_spinlock_lock(&thread->lock, false);211 212 assert(thread->sleep_interruptible);213 214 if ((thread->timeout_pending) &&215 (timeout_unregister(&thread->sleep_timeout)))216 thread->timeout_pending = false;217 218 list_remove(&thread->wq_link);219 thread->saved_context = thread->sleep_interruption_context;220 thread->sleep_queue = NULL;221 222 irq_spinlock_unlock(&thread->lock, false);223 thread_ready(thread);224 }225 226 irq_spinlock_unlock(&wq->lock, true);227 192 } 228 193
Note:
See TracChangeset
for help on using the changeset viewer.