Subversion Repositories HelenOS

Rev

Rev 2534 | Rev 2569 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2534 Rev 2568
Line 360... Line 360...
360
         * Note: the current fibril will be rescheduled either due to a
360
         * Note: the current fibril will be rescheduled either due to a
361
         * timeout or due to an arriving message destined to it. In the
361
         * timeout or due to an arriving message destined to it. In the
362
         * former case, handle_expired_timeouts() and, in the latter
362
         * former case, handle_expired_timeouts() and, in the latter
363
         * case, route_call() will perform the wakeup.
363
         * case, route_call() will perform the wakeup.
364
         */
364
         */
365
        fibril_schedule_next_adv(FIBRIL_TO_MANAGER);
365
        fibril_switch(FIBRIL_TO_MANAGER);
366
        /*
366
        /*
367
         * Futex is up after getting back from async_manager get it
367
         * Futex is up after getting back from async_manager get it
368
         * again.
368
         * again.
369
         */
369
         */
370
        futex_down(&async_futex);
370
        futex_down(&async_futex);
Line 582... Line 582...
582
    int timeout;
582
    int timeout;
583
    awaiter_t *waiter;
583
    awaiter_t *waiter;
584
    struct timeval tv;
584
    struct timeval tv;
585
 
585
 
586
    while (1) {
586
    while (1) {
587
        if (fibril_schedule_next_adv(FIBRIL_FROM_MANAGER)) {
587
        if (fibril_switch(FIBRIL_FROM_MANAGER)) {
588
            futex_up(&async_futex);
588
            futex_up(&async_futex);
589
            /*
589
            /*
590
             * async_futex is always held when entering a manager
590
             * async_futex is always held when entering a manager
591
             * fibril.
591
             * fibril.
592
             */
592
             */
Line 801... Line 801...
801
 
801
 
802
    msg->wdata.fid = fibril_get_id();
802
    msg->wdata.fid = fibril_get_id();
803
    msg->wdata.active = 0;
803
    msg->wdata.active = 0;
804
    msg->wdata.inlist = 0;
804
    msg->wdata.inlist = 0;
805
    /* Leave the async_futex locked when entering this function */
805
    /* Leave the async_futex locked when entering this function */
806
    fibril_schedule_next_adv(FIBRIL_TO_MANAGER);
806
    fibril_switch(FIBRIL_TO_MANAGER);
807
    /* futex is up automatically after fibril_schedule_next...*/
807
    /* futex is up automatically after fibril_switch...*/
808
done:
808
done:
809
    if (retval)
809
    if (retval)
810
        *retval = msg->retval;
810
        *retval = msg->retval;
811
    free(msg);
811
    free(msg);
812
}
812
}
Line 840... Line 840...
840
    msg->wdata.fid = fibril_get_id();
840
    msg->wdata.fid = fibril_get_id();
841
    msg->wdata.active = 0;
841
    msg->wdata.active = 0;
842
    insert_timeout(&msg->wdata);
842
    insert_timeout(&msg->wdata);
843
 
843
 
844
    /* Leave the async_futex locked when entering this function */
844
    /* Leave the async_futex locked when entering this function */
845
    fibril_schedule_next_adv(FIBRIL_TO_MANAGER);
845
    fibril_switch(FIBRIL_TO_MANAGER);
846
    /* futex is up automatically after fibril_schedule_next...*/
846
    /* futex is up automatically after fibril_switch...*/
847
 
847
 
848
    if (!msg->done)
848
    if (!msg->done)
849
        return ETIMEOUT;
849
        return ETIMEOUT;
850
 
850
 
851
done:
851
done:
Line 882... Line 882...
882
    tv_add(&msg->wdata.expires, timeout);
882
    tv_add(&msg->wdata.expires, timeout);
883
 
883
 
884
    futex_down(&async_futex);
884
    futex_down(&async_futex);
885
    insert_timeout(&msg->wdata);
885
    insert_timeout(&msg->wdata);
886
    /* Leave the async_futex locked when entering this function */
886
    /* Leave the async_futex locked when entering this function */
887
    fibril_schedule_next_adv(FIBRIL_TO_MANAGER);
887
    fibril_switch(FIBRIL_TO_MANAGER);
888
    /* futex is up automatically after fibril_schedule_next_adv()...*/
888
    /* futex is up automatically after fibril_switch()...*/
889
    free(msg);
889
    free(msg);
890
}
890
}
891
 
891
 
892
/** Setter for client_connection function pointer.
892
/** Setter for client_connection function pointer.
893
 *
893
 *