Ignore:
File:
1 edited

Legend:

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

    r78192cc7 rb243da3  
    7878                goto error;
    7979
    80         fibril_mutex_initialize(&conn->lock);
    81 
    82         conn->tw_timer = fibril_timer_create(&conn->lock);
     80        conn->tw_timer = fibril_timer_create();
    8381        if (conn->tw_timer == NULL)
    8482                goto error;
     83
     84        fibril_mutex_initialize(&conn->lock);
    8585
    8686        /* One for the user, one for not being in closed state */
     
    200200        if (atomic_predec(&conn->refcnt) == 0)
    201201                tcp_conn_free(conn);
    202 }
    203 
    204 /** Lock connection.
    205  *
    206  * Must be called before any other connection-manipulating function,
    207  * except tcp_conn_{add|del}ref(). Locks the connection including
    208  * its timers. Must not be called inside any of the connection
    209  * timer handlers.
    210  *
    211  * @param conn          Connection
    212  */
    213 void tcp_conn_lock(tcp_conn_t *conn)
    214 {
    215         fibril_mutex_lock(&conn->lock);
    216 }
    217 
    218 /** Unlock connection.
    219  *
    220  * @param conn          Connection
    221  */
    222 void tcp_conn_unlock(tcp_conn_t *conn)
    223 {
    224         fibril_mutex_unlock(&conn->lock);
    225202}
    226203
     
    12061183        log_msg(LOG_DEFAULT, LVL_DEBUG, "tw_timeout_func(%p)", conn);
    12071184
    1208         tcp_conn_lock(conn);
     1185        fibril_mutex_lock(&conn->lock);
    12091186
    12101187        if (conn->cstate == st_closed) {
    12111188                log_msg(LOG_DEFAULT, LVL_DEBUG, "Connection already closed.");
    1212                 tcp_conn_unlock(conn);
     1189                fibril_mutex_unlock(&conn->lock);
    12131190                tcp_conn_delref(conn);
    12141191                return;
     
    12191196        tcp_conn_state_set(conn, st_closed);
    12201197
    1221         tcp_conn_unlock(conn);
     1198        fibril_mutex_unlock(&conn->lock);
    12221199        tcp_conn_delref(conn);
    1223 
    1224         log_msg(LOG_DEFAULT, LVL_DEBUG, "tw_timeout_func(%p) end", conn);
    12251200}
    12261201
     
    12311206void tcp_conn_tw_timer_set(tcp_conn_t *conn)
    12321207{
    1233         log_msg(LOG_DEFAULT, LVL_DEBUG2, "tcp_conn_tw_timer_set() begin");
    12341208        tcp_conn_addref(conn);
    1235         fibril_timer_set_locked(conn->tw_timer, TIME_WAIT_TIMEOUT,
    1236             tw_timeout_func, (void *)conn);
    1237         log_msg(LOG_DEFAULT, LVL_DEBUG2, "tcp_conn_tw_timer_set() end");
     1209        fibril_timer_set(conn->tw_timer, TIME_WAIT_TIMEOUT, tw_timeout_func,
     1210            (void *)conn);
    12381211}
    12391212
     
    12441217void tcp_conn_tw_timer_clear(tcp_conn_t *conn)
    12451218{
    1246         log_msg(LOG_DEFAULT, LVL_DEBUG2, "tcp_conn_tw_timer_clear() begin");
    1247         if (fibril_timer_clear_locked(conn->tw_timer) == fts_active)
     1219        if (fibril_timer_clear(conn->tw_timer) == fts_active)
    12481220                tcp_conn_delref(conn);
    1249         log_msg(LOG_DEFAULT, LVL_DEBUG2, "tcp_conn_tw_timer_clear() end");
    12501221}
    12511222
Note: See TracChangeset for help on using the changeset viewer.