Changeset 525df28 in mainline for uspace/lib/c/generic/fibril_synch.c
- Timestamp:
- 2010-10-19T19:03:50Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1fa010c
- Parents:
- 7f122e3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/fibril_synch.c
r7f122e3 r525df28 65 65 void fibril_mutex_lock(fibril_mutex_t *fm) 66 66 { 67 fibril_t *f = (fibril_t *) fibril_get_id(); 68 67 69 futex_down(&async_futex); 68 70 if (fm->counter-- <= 0) { … … 74 76 link_initialize(&wdata.wu_event.link); 75 77 list_append(&wdata.wu_event.link, &fm->waiters); 78 79 f->waits_for = &fm->oi; 80 76 81 fibril_switch(FIBRIL_TO_MANAGER); 77 82 } else { 78 fm->oi.owned_by = (fibril_t *) fibril_get_id();83 fm->oi.owned_by = f; 79 84 futex_up(&async_futex); 80 85 } … … 102 107 link_t *tmp; 103 108 awaiter_t *wdp; 109 fibril_t *f; 104 110 105 111 assert(!list_empty(&fm->waiters)); … … 108 114 wdp->active = true; 109 115 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 111 121 list_remove(&wdp->wu_event.link); 112 122 fibril_add_ready(wdp->fid);
Note:
See TracChangeset
for help on using the changeset viewer.