Changeset ab6edb6 in mainline for uspace/lib/c/generic/async/server.c


Ignore:
Timestamp:
2018-06-26T17:34:48Z (6 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e768aea
Parents:
b59318e
git-author:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-06-25 19:28:19)
git-committer:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-06-26 17:34:48)
Message:

Simplify the interaction between async_futex and fibril_switch().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/async/server.c

    rb59318e rab6edb6  
    997997                 * case, route_call() will perform the wakeup.
    998998                 */
    999                 fibril_switch(FIBRIL_TO_MANAGER);
    1000 
    1001                 /*
    1002                  * Futex is up after getting back from async_manager.
    1003                  * Get it again.
    1004                  */
    1005                 futex_lock(&async_futex);
     999                fibril_switch(FIBRIL_FROM_BLOCKED);
     1000
    10061001                if ((usecs) && (conn->wdata.to_event.occurred) &&
    10071002                    (list_empty(&conn->msg_queue))) {
     
    11431138{
    11441139        while (true) {
    1145                 if (fibril_switch(FIBRIL_FROM_MANAGER)) {
    1146                         futex_unlock(&async_futex);
    1147                         /*
    1148                          * async_futex is always held when entering a manager
    1149                          * fibril.
    1150                          */
    1151                         continue;
    1152                 }
    1153 
    11541140                futex_lock(&async_futex);
     1141                fibril_switch(FIBRIL_FROM_MANAGER);
     1142
     1143                /*
     1144                 * The switch only returns when there is no non-manager fibril
     1145                 * it can run.
     1146                 */
    11551147
    11561148                suseconds_t timeout;
     
    12261218static errno_t async_manager_fibril(void *arg)
    12271219{
    1228         futex_unlock(&async_futex);
    1229 
    1230         /*
    1231          * async_futex is always locked when entering manager
    1232          */
    12331220        async_manager_worker();
    1234 
    12351221        return 0;
    12361222}
Note: See TracChangeset for help on using the changeset viewer.