Changeset 7c15d6f in mainline for uspace/lib/c/generic/fibril_synch.c
- Timestamp:
- 2015-06-06T15:20:52Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9362cc2
- Parents:
- 1ede059
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/fibril_synch.c
r1ede059 r7c15d6f 461 461 if (rc == ETIMEOUT && timer->state == fts_active) { 462 462 timer->state = fts_fired; 463 timer->handler_ running = true;463 timer->handler_fid = fibril_get_id(); 464 464 fibril_mutex_unlock(timer->lockp); 465 465 timer->fun(timer->arg); 466 466 fibril_mutex_lock(timer->lockp); 467 timer->handler_ running = false;467 timer->handler_fid = 0; 468 468 } 469 469 break; … … 608 608 assert(fibril_mutex_is_locked(timer->lockp)); 609 609 610 while (timer->handler_running) 610 while (timer->handler_fid != 0) { 611 if (timer->handler_fid == fibril_get_id()) { 612 printf("Deadlock detected.\n"); 613 stacktrace_print(); 614 printf("Fibril %zx is trying to clear timer %p from " 615 "inside its handler %p.\n", 616 fibril_get_id(), timer, timer->fun); 617 abort(); 618 } 619 611 620 fibril_condvar_wait(&timer->cv, timer->lockp); 621 } 612 622 613 623 old_state = timer->state;
Note:
See TracChangeset
for help on using the changeset viewer.