Changeset 78192cc7 in mainline for uspace/srv/net/tcp/tqueue.c
- Timestamp:
- 2014-07-13T14:06:23Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- af2a76c, f303f2cf
- Parents:
- c1b979a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tcp/tqueue.c
rc1b979a r78192cc7 59 59 static void tcp_tqueue_timer_clear(tcp_conn_t *conn); 60 60 61 #include <stdio.h> 61 62 int tcp_tqueue_init(tcp_tqueue_t *tqueue, tcp_conn_t *conn) 62 63 { 64 printf("tcp_tqueue_init\n"); 63 65 tqueue->conn = conn; 64 tqueue->timer = fibril_timer_create( );66 tqueue->timer = fibril_timer_create(&conn->lock); 65 67 if (tqueue->timer == NULL) 66 68 return ENOMEM; … … 78 80 void tcp_tqueue_fini(tcp_tqueue_t *tqueue) 79 81 { 82 printf("tcp_tqueue_fini\n"); 80 83 if (tqueue->timer != NULL) { 81 84 fibril_timer_destroy(tqueue->timer); … … 319 322 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: retransmit_timeout_func(%p)", conn->name, conn); 320 323 321 fibril_mutex_lock(&conn->lock);324 tcp_conn_lock(conn); 322 325 323 326 if (conn->cstate == st_closed) { 324 327 log_msg(LOG_DEFAULT, LVL_DEBUG, "Connection already closed."); 325 fibril_mutex_unlock(&conn->lock);328 tcp_conn_unlock(conn); 326 329 tcp_conn_delref(conn); 327 330 return; … … 331 334 if (link == NULL) { 332 335 log_msg(LOG_DEFAULT, LVL_DEBUG, "Nothing to retransmit"); 333 fibril_mutex_unlock(&conn->lock);336 tcp_conn_unlock(conn); 334 337 tcp_conn_delref(conn); 335 338 return; … … 341 344 if (rt_seg == NULL) { 342 345 log_msg(LOG_DEFAULT, LVL_ERROR, "Memory allocation failed."); 343 fibril_mutex_unlock(&conn->lock);346 tcp_conn_unlock(conn); 344 347 tcp_conn_delref(conn); 345 348 /* XXX Handle properly */ … … 353 356 tcp_tqueue_timer_set(tqe->conn); 354 357 355 fibril_mutex_unlock(&conn->lock);358 tcp_conn_unlock(conn); 356 359 tcp_conn_delref(conn); 360 361 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: retransmit_timeout_func(%p) end", conn->name, conn); 357 362 } 358 363 … … 360 365 static void tcp_tqueue_timer_set(tcp_conn_t *conn) 361 366 { 362 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_set() ", conn->name);367 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_set() begin", conn->name); 363 368 364 369 /* Clear first to make sure we update refcnt correctly */ … … 366 371 367 372 tcp_conn_addref(conn); 368 fibril_timer_set (conn->retransmit.timer, RETRANSMIT_TIMEOUT,373 fibril_timer_set_locked(conn->retransmit.timer, RETRANSMIT_TIMEOUT, 369 374 retransmit_timeout_func, (void *) conn); 375 376 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_set() end", conn->name); 370 377 } 371 378 … … 373 380 static void tcp_tqueue_timer_clear(tcp_conn_t *conn) 374 381 { 375 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_clear() ", conn->name);376 377 if (fibril_timer_clear (conn->retransmit.timer) == fts_active)382 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_clear() begin", conn->name); 383 384 if (fibril_timer_clear_locked(conn->retransmit.timer) == fts_active) 378 385 tcp_conn_delref(conn); 386 387 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_clear() end", conn->name); 379 388 } 380 389
Note:
See TracChangeset
for help on using the changeset viewer.