Changeset ab6edb6 in mainline for uspace/lib/c/generic/fibril_synch.c
- Timestamp:
- 2018-06-26T17:34:48Z (6 years ago)
- 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/fibril_synch.c
rb59318e rab6edb6 116 116 check_for_deadlock(&fm->oi); 117 117 f->waits_for = &fm->oi; 118 fibril_switch(FIBRIL_ TO_MANAGER);118 fibril_switch(FIBRIL_FROM_BLOCKED); 119 119 } else { 120 120 fm->oi.owned_by = f; 121 futex_unlock(&async_futex);122 }121 } 122 futex_unlock(&async_futex); 123 123 } 124 124 … … 206 206 check_for_deadlock(&frw->oi); 207 207 f->waits_for = &frw->oi; 208 fibril_switch(FIBRIL_ TO_MANAGER);208 fibril_switch(FIBRIL_FROM_BLOCKED); 209 209 } else { 210 210 /* Consider the first reader the owner. */ 211 211 if (frw->readers++ == 0) 212 212 frw->oi.owned_by = f; 213 futex_unlock(&async_futex);214 }213 } 214 futex_unlock(&async_futex); 215 215 } 216 216 … … 230 230 check_for_deadlock(&frw->oi); 231 231 f->waits_for = &frw->oi; 232 fibril_switch(FIBRIL_ TO_MANAGER);232 fibril_switch(FIBRIL_FROM_BLOCKED); 233 233 } else { 234 234 frw->oi.owned_by = f; 235 235 frw->writers++; 236 futex_unlock(&async_futex);237 }236 } 237 futex_unlock(&async_futex); 238 238 } 239 239 … … 377 377 list_append(&wdata.wu_event.link, &fcv->waiters); 378 378 _fibril_mutex_unlock_unsafe(fm); 379 fibril_switch(FIBRIL_TO_MANAGER); 379 fibril_switch(FIBRIL_FROM_BLOCKED); 380 futex_unlock(&async_futex); 381 382 // XXX: This could be replaced with an unlocked version to get rid 383 // of the unlock-lock pair. I deliberately don't do that because 384 // further changes would most likely need to revert that optimization. 380 385 fibril_mutex_lock(fm); 381 386 382 /* async_futex not held after fibril_switch() */383 387 futex_lock(&async_futex); 384 388 if (wdata.to_event.inlist) … … 698 702 wdata.fid = fibril_get_id(); 699 703 list_append(&wdata.wu_event.link, &sem->waiters); 700 fibril_switch(FIBRIL_TO_MANAGER); 701 702 /* async_futex not held after fibril_switch() */704 705 fibril_switch(FIBRIL_FROM_BLOCKED); 706 futex_unlock(&async_futex); 703 707 } 704 708
Note:
See TracChangeset
for help on using the changeset viewer.