Changeset 440cff5 in mainline


Ignore:
Timestamp:
2006-05-31T15:19:09Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b27a97bb
Parents:
fc42b28
Message:

Added pseudo-synchronous message sending.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libc/include/async.h

    rfc42b28 r440cff5  
    1010
    1111int async_manager(void);
    12 void async_create_manager(void);
    13 void async_destroy_manager(void);
    14 int _async_init(void);
    1512ipc_callid_t async_get_call(ipc_call_t *data);
     13
    1614
    1715aid_t async_send_2(int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2,
     
    1917void async_wait_for(aid_t amsgid, ipcarg_t *result);
    2018int async_wait_timeout(aid_t amsgid, ipcarg_t *retval, suseconds_t timeout);
     19
     20/** Pseudo-synchronous message sending
     21 *
     22 * Send message through IPC, wait in the event loop, until it is received
     23 *
     24 * @return Return code of message
     25 */
     26static inline ipcarg_t sync_send_2(int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t *r1, ipcarg_t *r2)
     27{
     28        ipc_call_t result;
     29        ipcarg_t rc;
     30
     31        aid_t eid = async_send_2(phoneid, method, arg1, arg2, &result);
     32        async_wait_for(eid, &rc);
     33        if (r1)
     34                *r1 = IPC_GET_ARG1(result);
     35        if (r2)
     36                *r2 = IPC_GET_ARG2(result);
     37        return rc;
     38}
     39
     40
    2141pstid_t async_new_connection(ipcarg_t in_phone_hash,ipc_callid_t callid,
    2242                             ipc_call_t *call,
    2343                             void (*cthread)(ipc_callid_t,ipc_call_t *));
    2444void async_usleep(suseconds_t timeout);
     45void async_create_manager(void);
     46void async_destroy_manager(void);
     47int _async_init(void);
    2548
    2649/* Should be defined by application */
Note: See TracChangeset for help on using the changeset viewer.