Changeset 58775d30 in mainline for uspace/lib/c/generic/ipc.c
- Timestamp:
- 2015-03-16T16:07:21Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2003739
- Parents:
- 6069061 (diff), 795e2bf (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/ipc.c
r6069061 r58775d30 81 81 LIST_INITIALIZE(queued_calls); 82 82 83 static atomic_t ipc_futex = FUTEX_INITIALIZER;83 static futex_t ipc_futex = FUTEX_INITIALIZER; 84 84 85 85 /** Send asynchronous message via syscall. … … 136 136 if (!call) { 137 137 /* Nothing to do regardless if failed or not */ 138 futex_u p(&ipc_futex);138 futex_unlock(&ipc_futex); 139 139 return; 140 140 } 141 141 142 142 if (callid == (ipc_callid_t) IPC_CALLRET_FATAL) { 143 futex_u p(&ipc_futex);143 futex_unlock(&ipc_futex); 144 144 145 145 /* Call asynchronous handler with error code */ … … 152 152 153 153 if (callid == (ipc_callid_t) IPC_CALLRET_TEMPORARY) { 154 futex_u p(&ipc_futex);154 futex_unlock(&ipc_futex); 155 155 156 156 call->u.msg.phoneid = phoneid; … … 175 175 /* Add call to the list of dispatched calls */ 176 176 list_append(&call->list, &dispatched_calls); 177 futex_u p(&ipc_futex);177 futex_unlock(&ipc_futex); 178 178 } 179 179 … … 219 219 */ 220 220 221 futex_ down(&ipc_futex);221 futex_lock(&ipc_futex); 222 222 ipc_callid_t callid = __SYSCALL6(SYS_IPC_CALL_ASYNC_FAST, phoneid, 223 223 imethod, arg1, arg2, arg3, arg4); … … 226 226 if (!call) { 227 227 call = ipc_prepare_async(private, callback); 228 if (!call) 228 if (!call) { 229 futex_unlock(&ipc_futex); 229 230 return; 231 } 230 232 } 231 233 … … 289 291 */ 290 292 291 futex_ down(&ipc_futex);293 futex_lock(&ipc_futex); 292 294 ipc_callid_t callid = 293 295 ipc_call_async_internal(phoneid, &call->u.msg.data); … … 384 386 call->u.callid = callid; 385 387 386 futex_ down(&ipc_futex);388 futex_lock(&ipc_futex); 387 389 list_append(&call->list, &dispatched_calls); 388 futex_u p(&ipc_futex);390 futex_unlock(&ipc_futex); 389 391 } 390 392 … … 412 414 callid &= ~IPC_CALLID_ANSWERED; 413 415 414 futex_ down(&ipc_futex);416 futex_lock(&ipc_futex); 415 417 416 418 link_t *item; … … 423 425 list_remove(&call->list); 424 426 425 futex_u p(&ipc_futex);427 futex_unlock(&ipc_futex); 426 428 427 429 if (call->callback) … … 434 436 } 435 437 436 futex_u p(&ipc_futex);438 futex_unlock(&ipc_futex); 437 439 } 438 440
Note:
See TracChangeset
for help on using the changeset viewer.