Changeset 7c15d6f in mainline
- 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
- Location:
- uspace
- Files:
-
- 3 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; -
uspace/lib/c/include/fibril_synch.h
r1ede059 r7c15d6f 135 135 fid_t fibril; 136 136 fibril_timer_state_t state; 137 bool handler_running; 137 /** FID of fibril executing handler or 0 if handler is not running */ 138 fid_t handler_fid; 138 139 139 140 suseconds_t delay; -
uspace/srv/net/tcp/tqueue.c
r1ede059 r7c15d6f 351 351 352 352 /* Reset retransmission timer */ 353 tcp_tqueue_timer_set(tqe->conn); 353 fibril_timer_set_locked(conn->retransmit.timer, RETRANSMIT_TIMEOUT, 354 retransmit_timeout_func, (void *) conn); 354 355 355 356 tcp_conn_unlock(conn); 356 tcp_conn_delref(conn);357 357 358 358 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: retransmit_timeout_func(%p) end", conn->name, conn);
Note:
See TracChangeset
for help on using the changeset viewer.