Changeset 8565a42 in mainline for uspace/lib/c/generic/fibril_synch.c
- Timestamp:
- 2018-03-02T20:34:50Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a1a81f69, d5e5fd1
- Parents:
- 3061bc1 (diff), 34e1206 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:34:50)
- git-committer:
- GitHub <noreply@…> (2018-03-02 20:34:50)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/fibril_synch.c
r3061bc1 r8565a42 125 125 { 126 126 bool locked = false; 127 127 128 128 futex_down(&async_futex); 129 129 if (fm->counter > 0) { … … 133 133 } 134 134 futex_up(&async_futex); 135 135 136 136 return locked; 137 137 } … … 143 143 awaiter_t *wdp; 144 144 fibril_t *f; 145 145 146 146 tmp = list_first(&fm->waiters); 147 147 assert(tmp != NULL); … … 173 173 { 174 174 bool locked = false; 175 175 176 176 futex_down(&async_futex); 177 177 if (fm->counter <= 0) 178 178 locked = true; 179 179 futex_up(&async_futex); 180 180 181 181 return locked; 182 182 } … … 193 193 { 194 194 fibril_t *f = (fibril_t *) fibril_get_id(); 195 195 196 196 futex_down(&async_futex); 197 197 if (frw->writers) { … … 217 217 { 218 218 fibril_t *f = (fibril_t *) fibril_get_id(); 219 219 220 220 futex_down(&async_futex); 221 221 if (frw->writers || frw->readers) { … … 261 261 frw->writers--; 262 262 } 263 263 264 264 assert(!frw->readers && !frw->writers); 265 265 266 266 frw->oi.owned_by = NULL; 267 267 268 268 while (!list_empty(&frw->waiters)) { 269 269 link_t *tmp = list_first(&frw->waiters); 270 270 awaiter_t *wdp; 271 271 fibril_t *f; 272 272 273 273 wdp = list_get_instance(tmp, awaiter_t, wu_event.link); 274 274 f = (fibril_t *) wdp->fid; 275 275 276 276 f->waits_for = NULL; 277 277 278 278 if (f->flags & FIBRIL_WRITER) { 279 279 if (frw->readers) … … 386 386 list_remove(&wdata.wu_event.link); 387 387 futex_up(&async_futex); 388 388 389 389 return wdata.to_event.occurred ? ETIMEOUT : EOK; 390 390 }
Note:
See TracChangeset
for help on using the changeset viewer.