Changeset 0b99e40 in mainline for libc/generic/async.c


Ignore:
Timestamp:
2006-05-28T18:22:10Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2d1fde3b
Parents:
7f5b37a
Message:

Rough implementation of gettimeofday.
IPC_M_RECV_AS doesn't allow us to specify additional user parametrs. That
doesn't seem to be very configurable :-/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libc/generic/async.c

    r7f5b37a r0b99e40  
    332332        ipc_call_t call;
    333333        ipc_callid_t callid;
     334        int timeout;
    334335
    335336        while (1) {
     
    340341                        continue;
    341342                }
    342                 callid = ipc_wait_cycle(&call,SYNCH_NO_TIMEOUT,SYNCH_BLOCKING);
     343/*
     344                if (expires)
     345                        timeout = .... ;
     346                else
     347*/
     348                        timeout = SYNCH_NO_TIMEOUT;
     349                callid = ipc_wait_cycle(&call, timeout, SYNCH_BLOCKING);
     350
     351                if (!callid) {
     352//                      handle_expired_timeouts.......;
     353                        continue;
     354                }
    343355
    344356                if (callid & IPC_CALLID_ANSWERED)
     
    405417        if (msg->dataptr)
    406418                *msg->dataptr = *data;
    407        
     419
     420        /* TODO: memory barrier?? */
    408421        msg->done = 1;
    409422        if (! msg->active) {
     
    461474        free(msg);
    462475}
     476
     477
     478/* int async_wait_timeout(aid_t amsgid, ipcarg_t *retval, int timeout) */
     479/* { */
     480/*      amsg_t *msg = (amsg_t *) amsgid; */
     481/*      connection_t *conn; */
     482
     483/*      futex_down(&async_futex); */
     484/*      if (msg->done) { */
     485/*              futex_up(&async_futex); */
     486/*              goto done; */
     487/*      } */
     488
     489/*      msg->ptid = psthread_get_id(); */
     490/*      msg->active = 0; */
     491/*      msg->expires = gettime() + timeout; */
     492/*      setup_timeouts_etc...(); */
     493
     494/*      /\* Leave locked async_futex when entering this function *\/ */
     495/*      psthread_schedule_next_adv(PS_TO_MANAGER); */
     496/*      /\* futex is up automatically after psthread_schedule_next...*\/ */
     497
     498/*      if (!msg->done) */
     499/*              return casy-casy; */
     500
     501/*      /\* TODO: When memory barrier in reply_received, we can skip this *\/ */
     502/*      futex_down(&async_futex); */
     503/*      futex_up(&async_futex); */
     504/* done: */
     505       
     506/*      if (retval) */
     507/*              *retval = msg->retval; */
     508/*      free(msg); */
     509/* } */
     510
Note: See TracChangeset for help on using the changeset viewer.