Changes in uspace/srv/net/tcp/tqueue.c [c0f3460:f303f2cf] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tcp/tqueue.c
rc0f3460 rf303f2cf 62 62 { 63 63 tqueue->conn = conn; 64 tqueue->timer = fibril_timer_create( );64 tqueue->timer = fibril_timer_create(&conn->lock); 65 65 if (tqueue->timer == NULL) 66 66 return ENOMEM; … … 92 92 seg = tcp_segment_make_ctrl(ctrl); 93 93 tcp_tqueue_seg(conn, seg); 94 tcp_segment_delete(seg); 94 95 } 95 96 … … 212 213 213 214 tcp_tqueue_seg(conn, seg); 215 tcp_segment_delete(seg); 214 216 } 215 217 … … 317 319 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: retransmit_timeout_func(%p)", conn->name, conn); 318 320 319 fibril_mutex_lock(&conn->lock);321 tcp_conn_lock(conn); 320 322 321 323 if (conn->cstate == st_closed) { 322 324 log_msg(LOG_DEFAULT, LVL_DEBUG, "Connection already closed."); 323 fibril_mutex_unlock(&conn->lock);325 tcp_conn_unlock(conn); 324 326 tcp_conn_delref(conn); 325 327 return; … … 329 331 if (link == NULL) { 330 332 log_msg(LOG_DEFAULT, LVL_DEBUG, "Nothing to retransmit"); 331 fibril_mutex_unlock(&conn->lock);333 tcp_conn_unlock(conn); 332 334 tcp_conn_delref(conn); 333 335 return; … … 339 341 if (rt_seg == NULL) { 340 342 log_msg(LOG_DEFAULT, LVL_ERROR, "Memory allocation failed."); 341 fibril_mutex_unlock(&conn->lock);343 tcp_conn_unlock(conn); 342 344 tcp_conn_delref(conn); 343 345 /* XXX Handle properly */ … … 351 353 tcp_tqueue_timer_set(tqe->conn); 352 354 353 fibril_mutex_unlock(&conn->lock);355 tcp_conn_unlock(conn); 354 356 tcp_conn_delref(conn); 357 358 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: retransmit_timeout_func(%p) end", conn->name, conn); 355 359 } 356 360 … … 358 362 static void tcp_tqueue_timer_set(tcp_conn_t *conn) 359 363 { 360 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_set() ", conn->name);364 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_set() begin", conn->name); 361 365 362 366 /* Clear first to make sure we update refcnt correctly */ … … 364 368 365 369 tcp_conn_addref(conn); 366 fibril_timer_set (conn->retransmit.timer, RETRANSMIT_TIMEOUT,370 fibril_timer_set_locked(conn->retransmit.timer, RETRANSMIT_TIMEOUT, 367 371 retransmit_timeout_func, (void *) conn); 372 373 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_set() end", conn->name); 368 374 } 369 375 … … 371 377 static void tcp_tqueue_timer_clear(tcp_conn_t *conn) 372 378 { 373 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_clear() ", conn->name);374 375 if (fibril_timer_clear (conn->retransmit.timer) == fts_active)379 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_clear() begin", conn->name); 380 381 if (fibril_timer_clear_locked(conn->retransmit.timer) == fts_active) 376 382 tcp_conn_delref(conn); 383 384 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_clear() end", conn->name); 377 385 } 378 386
Note:
See TracChangeset
for help on using the changeset viewer.