Changeset f6372be9 in mainline for uspace/lib/c/generic/fibril.c


Ignore:
Timestamp:
2018-06-26T17:34:23Z (7 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:
b59318e
Parents:
38e34273
git-author:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-06-25 20:50:53)
git-committer:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-06-26 17:34:23)
Message:

Improve the debugging options for futexes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/fibril.c

    r38e34273 rf6372be9  
    150150        case FIBRIL_FROM_DEAD:
    151151                /* Make sure the async_futex is held. */
    152                 assert((atomic_signed_t) async_futex.val.count <= 0);
     152                futex_assert_is_locked(&async_futex);
    153153
    154154                /* If we are going to manager and none exists, create it */
     
    162162                    fibril_t, link);
    163163
     164                /* Bookkeeping. */
     165                futex_give_to(&async_futex, dstf);
     166
    164167                if (stype == FIBRIL_FROM_DEAD)
    165168                        dstf->clean_after_me = srcf;
     
    167170        case FIBRIL_PREEMPT:
    168171        case FIBRIL_FROM_MANAGER:
     172                futex_assert_is_not_locked(&async_futex);
     173
    169174                if (list_empty(&ready_list)) {
    170175                        futex_unlock(&fibril_futex);
     
    196201                break;
    197202        }
     203
     204        /* Bookkeeping. */
     205        futex_give_to(&fibril_futex, dstf);
    198206
    199207        /* Swap to the next fibril. */
Note: See TracChangeset for help on using the changeset viewer.