Changeset bd5a663 in mainline for generic/src/ipc/ipc.c
- Timestamp:
- 2006-05-17T14:03:44Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 59477e3
- Parents:
- bdb9ea8
- File:
-
- 1 edited
-
generic/src/ipc/ipc.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
generic/src/ipc/ipc.c
rbdb9ea8 rbd5a663 34 34 #include <synch/spinlock.h> 35 35 #include <synch/waitq.h> 36 #include <synch/synch.h> 36 37 #include <ipc/ipc.h> 37 38 #include <errno.h> … … 142 143 143 144 ipc_call(phone, request); 144 ipc_wait_for_call(&sync_box, 0);145 ipc_wait_for_call(&sync_box, SYNCH_NO_TIMEOUT, SYNCH_BLOCKING); 145 146 } 146 147 … … 302 303 /** Wait for phone call 303 304 * 305 * @param box Answerbox expecting the call. 306 * @param usec Timeout in microseconds. See documentation for waitq_sleep_timeout() for 307 * decription of its special meaning. 308 * @param nonblocking Blocking vs. non-blocking operation mode switch. See documentation 309 * for waitq_sleep_timeout() for description of its special meaning. 304 310 * @return Recived message address 305 311 * - to distinguish between call and answer, look at call->flags 306 312 */ 307 call_t * ipc_wait_for_call(answerbox_t *box, int flags)313 call_t * ipc_wait_for_call(answerbox_t *box, __u32 usec, int nonblocking) 308 314 { 309 315 call_t *request; 310 316 ipl_t ipl; 311 312 restart: 313 if (flags & IPC_WAIT_NONBLOCKING) { 314 if (waitq_sleep_timeout(&box->wq,0,1) == ESYNCH_WOULD_BLOCK) 315 return NULL; 316 } else 317 waitq_sleep(&box->wq); 317 int rc; 318 319 restart: 320 rc = waitq_sleep_timeout(&box->wq, usec, nonblocking); 321 if (SYNCH_FAILED(rc)) 322 return NULL; 318 323 319 324 spinlock_lock(&box->lock); … … 408 413 /* Wait for all async answers to arrive */ 409 414 while (atomic_get(&task->active_calls)) { 410 call = ipc_wait_for_call(&task->answerbox, 0);415 call = ipc_wait_for_call(&task->answerbox, SYNCH_NO_TIMEOUT, SYNCH_BLOCKING); 411 416 ASSERT((call->flags & IPC_CALL_ANSWERED) || (call->flags & IPC_CALL_NOTIF)); 412 417 ASSERT(! (call->flags & IPC_CALL_STATIC_ALLOC));
Note:
See TracChangeset
for help on using the changeset viewer.
