Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/tcp/tqueue.c

    r78192cc7 rc0f3460  
    5959static void tcp_tqueue_timer_clear(tcp_conn_t *conn);
    6060
    61 #include <stdio.h>
    6261int tcp_tqueue_init(tcp_tqueue_t *tqueue, tcp_conn_t *conn)
    6362{
    64         printf("tcp_tqueue_init\n");
    6563        tqueue->conn = conn;
    66         tqueue->timer = fibril_timer_create(&conn->lock);
     64        tqueue->timer = fibril_timer_create();
    6765        if (tqueue->timer == NULL)
    6866                return ENOMEM;
     
    8078void tcp_tqueue_fini(tcp_tqueue_t *tqueue)
    8179{
    82         printf("tcp_tqueue_fini\n");
    8380        if (tqueue->timer != NULL) {
    8481                fibril_timer_destroy(tqueue->timer);
     
    9592        seg = tcp_segment_make_ctrl(ctrl);
    9693        tcp_tqueue_seg(conn, seg);
    97         tcp_segment_delete(seg);
    9894}
    9995
     
    216212
    217213        tcp_tqueue_seg(conn, seg);
    218         tcp_segment_delete(seg);
    219214}
    220215
     
    322317        log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: retransmit_timeout_func(%p)", conn->name, conn);
    323318
    324         tcp_conn_lock(conn);
     319        fibril_mutex_lock(&conn->lock);
    325320
    326321        if (conn->cstate == st_closed) {
    327322                log_msg(LOG_DEFAULT, LVL_DEBUG, "Connection already closed.");
    328                 tcp_conn_unlock(conn);
     323                fibril_mutex_unlock(&conn->lock);
    329324                tcp_conn_delref(conn);
    330325                return;
     
    334329        if (link == NULL) {
    335330                log_msg(LOG_DEFAULT, LVL_DEBUG, "Nothing to retransmit");
    336                 tcp_conn_unlock(conn);
     331                fibril_mutex_unlock(&conn->lock);
    337332                tcp_conn_delref(conn);
    338333                return;
     
    344339        if (rt_seg == NULL) {
    345340                log_msg(LOG_DEFAULT, LVL_ERROR, "Memory allocation failed.");
    346                 tcp_conn_unlock(conn);
     341                fibril_mutex_unlock(&conn->lock);
    347342                tcp_conn_delref(conn);
    348343                /* XXX Handle properly */
     
    356351        tcp_tqueue_timer_set(tqe->conn);
    357352
    358         tcp_conn_unlock(conn);
     353        fibril_mutex_unlock(&conn->lock);
    359354        tcp_conn_delref(conn);
    360 
    361         log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: retransmit_timeout_func(%p) end", conn->name, conn);
    362355}
    363356
     
    365358static void tcp_tqueue_timer_set(tcp_conn_t *conn)
    366359{
    367         log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_set() begin", conn->name);
     360        log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_set()", conn->name);
    368361
    369362        /* Clear first to make sure we update refcnt correctly */
     
    371364
    372365        tcp_conn_addref(conn);
    373         fibril_timer_set_locked(conn->retransmit.timer, RETRANSMIT_TIMEOUT,
     366        fibril_timer_set(conn->retransmit.timer, RETRANSMIT_TIMEOUT,
    374367            retransmit_timeout_func, (void *) conn);
    375 
    376         log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_set() end", conn->name);
    377368}
    378369
     
    380371static void tcp_tqueue_timer_clear(tcp_conn_t *conn)
    381372{
    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)
     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)
    385376                tcp_conn_delref(conn);
    386 
    387         log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_clear() end", conn->name);
    388377}
    389378
Note: See TracChangeset for help on using the changeset viewer.