Changeset 15d0046 in mainline for uspace/srv/net/tcp/tqueue.c


Ignore:
Timestamp:
2014-09-12T13:22:33Z (10 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9b20126
Parents:
8db09e4 (diff), 105d8d6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 edited

Legend:

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

    r8db09e4 r15d0046  
    6262{
    6363        tqueue->conn = conn;
    64         tqueue->timer = fibril_timer_create();
     64        tqueue->timer = fibril_timer_create(&conn->lock);
    6565        if (tqueue->timer == NULL)
    6666                return ENOMEM;
     
    9292        seg = tcp_segment_make_ctrl(ctrl);
    9393        tcp_tqueue_seg(conn, seg);
     94        tcp_segment_delete(seg);
    9495}
    9596
     
    212213
    213214        tcp_tqueue_seg(conn, seg);
     215        tcp_segment_delete(seg);
    214216}
    215217
     
    317319        log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: retransmit_timeout_func(%p)", conn->name, conn);
    318320
    319         fibril_mutex_lock(&conn->lock);
     321        tcp_conn_lock(conn);
    320322
    321323        if (conn->cstate == st_closed) {
    322324                log_msg(LOG_DEFAULT, LVL_DEBUG, "Connection already closed.");
    323                 fibril_mutex_unlock(&conn->lock);
     325                tcp_conn_unlock(conn);
    324326                tcp_conn_delref(conn);
    325327                return;
     
    329331        if (link == NULL) {
    330332                log_msg(LOG_DEFAULT, LVL_DEBUG, "Nothing to retransmit");
    331                 fibril_mutex_unlock(&conn->lock);
     333                tcp_conn_unlock(conn);
    332334                tcp_conn_delref(conn);
    333335                return;
     
    339341        if (rt_seg == NULL) {
    340342                log_msg(LOG_DEFAULT, LVL_ERROR, "Memory allocation failed.");
    341                 fibril_mutex_unlock(&conn->lock);
     343                tcp_conn_unlock(conn);
    342344                tcp_conn_delref(conn);
    343345                /* XXX Handle properly */
     
    351353        tcp_tqueue_timer_set(tqe->conn);
    352354
    353         fibril_mutex_unlock(&conn->lock);
     355        tcp_conn_unlock(conn);
    354356        tcp_conn_delref(conn);
     357
     358        log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: retransmit_timeout_func(%p) end", conn->name, conn);
    355359}
    356360
     
    358362static void tcp_tqueue_timer_set(tcp_conn_t *conn)
    359363{
    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);
    361365
    362366        /* Clear first to make sure we update refcnt correctly */
     
    364368
    365369        tcp_conn_addref(conn);
    366         fibril_timer_set(conn->retransmit.timer, RETRANSMIT_TIMEOUT,
     370        fibril_timer_set_locked(conn->retransmit.timer, RETRANSMIT_TIMEOUT,
    367371            retransmit_timeout_func, (void *) conn);
     372
     373        log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_set() end", conn->name);
    368374}
    369375
     
    371377static void tcp_tqueue_timer_clear(tcp_conn_t *conn)
    372378{
    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)
    376382                tcp_conn_delref(conn);
     383
     384        log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_clear() end", conn->name);
    377385}
    378386
Note: See TracChangeset for help on using the changeset viewer.