Changeset 649efcd in mainline
- Timestamp:
- 2010-11-05T15:56:29Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 55bd76c
- Parents:
- 84b7384
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/fibril_synch.c
r84b7384 r649efcd 194 194 f->flags &= ~FIBRIL_WRITER; 195 195 list_append(&wdata.wu_event.link, &frw->waiters); 196 197 if (check_for_deadlock(&frw->oi)) 198 print_deadlock(&frw->oi); 199 f->waits_for = &frw->oi; 200 196 201 fibril_switch(FIBRIL_TO_MANAGER); 197 202 } else { … … 203 208 void fibril_rwlock_write_lock(fibril_rwlock_t *frw) 204 209 { 210 fibril_t *f = (fibril_t *) fibril_get_id(); 211 205 212 futex_down(&async_futex); 206 213 if (frw->writers || frw->readers) { 207 fibril_t *f = (fibril_t *) fibril_get_id();208 214 awaiter_t wdata; 209 215 … … 214 220 f->flags |= FIBRIL_WRITER; 215 221 list_append(&wdata.wu_event.link, &frw->waiters); 222 223 if (check_for_deadlock(&frw->oi)) 224 print_deadlock(&frw->oi); 225 f->waits_for = &frw->oi; 226 216 227 fibril_switch(FIBRIL_TO_MANAGER); 217 228 } else { 229 frw->oi.owned_by = f; 218 230 frw->writers++; 219 231 futex_up(&async_futex); … … 234 246 assert(!frw->readers && !frw->writers); 235 247 248 frw->oi.owned_by = NULL; 249 236 250 while (!list_empty(&frw->waiters)) { 237 251 link_t *tmp = frw->waiters.next; … … 241 255 wdp = list_get_instance(tmp, awaiter_t, wu_event.link); 242 256 f = (fibril_t *) wdp->fid; 257 258 f->waits_for = NULL; 243 259 244 260 if (f->flags & FIBRIL_WRITER) { … … 250 266 fibril_add_ready(wdp->fid); 251 267 frw->writers++; 268 frw->oi.owned_by = f; 252 269 optimize_execution_power(); 253 270 break;
Note:
See TracChangeset
for help on using the changeset viewer.