Changeset 854ad23 in mainline
- Timestamp:
- 2009-10-11T10:32:40Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b69bec5
- Parents:
- cadfa8e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/generic/fibril_sync.c
rcadfa8e r854ad23 66 66 futex_down(&async_futex); 67 67 if (fm->counter-- <= 0) { 68 fibril_t *f = (fibril_t *) fibril_get_id(); 69 list_append(&f->link, &fm->waiters); 68 awaiter_t wdata; 69 70 wdata.fid = fibril_get_id(); 71 wdata.active = false; 72 wdata.wu_event.inlist = true; 73 link_initialize(&wdata.wu_event.link); 74 list_append(&wdata.wu_event.link, &fm->waiters); 70 75 fibril_switch(FIBRIL_TO_MANAGER); 71 76 } else { … … 93 98 if (fm->counter++ < 0) { 94 99 link_t *tmp; 95 fibril_t *f;100 awaiter_t *wdp; 96 101 97 102 assert(!list_empty(&fm->waiters)); 98 103 tmp = fm->waiters.next; 99 f = list_get_instance(tmp, fibril_t, link); 100 list_remove(&f->link); 101 fibril_add_ready((fid_t) f); 104 wdp = list_get_instance(tmp, awaiter_t, wu_event.link); 105 wdp->wu_event.inlist = false; 106 list_remove(&wdp->wu_event.link); 107 fibril_add_ready(wdp->fid); 102 108 optimize_execution_power(); 103 109 }
Note:
See TracChangeset
for help on using the changeset viewer.