Changeset 525df28 in mainline


Ignore:
Timestamp:
2010-10-19T19:03:50Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1fa010c
Parents:
7f122e3
Message:

Record what synchronization primitive the fibril waits for.

File:
1 edited

Legend:

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

    r7f122e3 r525df28  
    6565void fibril_mutex_lock(fibril_mutex_t *fm)
    6666{
     67        fibril_t *f = (fibril_t *) fibril_get_id();
     68
    6769        futex_down(&async_futex);
    6870        if (fm->counter-- <= 0) {
     
    7476                link_initialize(&wdata.wu_event.link);
    7577                list_append(&wdata.wu_event.link, &fm->waiters);
     78
     79                f->waits_for = &fm->oi;
     80
    7681                fibril_switch(FIBRIL_TO_MANAGER);
    7782        } else {
    78                 fm->oi.owned_by = (fibril_t *) fibril_get_id();
     83                fm->oi.owned_by = f;
    7984                futex_up(&async_futex);
    8085        }
     
    102107                link_t *tmp;
    103108                awaiter_t *wdp;
     109                fibril_t *f;
    104110       
    105111                assert(!list_empty(&fm->waiters));
     
    108114                wdp->active = true;
    109115                wdp->wu_event.inlist = false;
    110                 fm->oi.owned_by = (fibril_t *) wdp->fid;
     116
     117                f = (fibril_t *) wdp->fid;
     118                fm->oi.owned_by = f;
     119                f->waits_for = NULL;
     120
    111121                list_remove(&wdp->wu_event.link);
    112122                fibril_add_ready(wdp->fid);
Note: See TracChangeset for help on using the changeset viewer.