Changeset 498ced1 in mainline for uspace/srv/net/tcp/conn.c
- Timestamp:
- 2018-08-11T02:43:32Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 05882233
- Parents:
- b13d80b
- git-author:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-08-11 02:29:02)
- git-committer:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-08-11 02:43:32)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tcp/conn.c
rb13d80b r498ced1 128 128 129 129 /* One for the user, one for not being in closed state */ 130 atomic_set(&conn->refcnt, 2); 130 refcount_init(&conn->refcnt); 131 refcount_up(&conn->refcnt); 131 132 132 133 /* Allocate receive buffer */ … … 238 239 void tcp_conn_addref(tcp_conn_t *conn) 239 240 { 240 log_msg(LOG_DEFAULT, LVL_DEBUG2, "%s: tcp_conn_addref(%p) before=%zu", 241 conn->name, conn, atomic_get(&conn->refcnt)); 242 atomic_inc(&conn->refcnt); 241 log_msg(LOG_DEFAULT, LVL_DEBUG2, "%s: tcp_conn_addref(%p)", 242 conn->name, conn); 243 244 refcount_up(&conn->refcnt); 243 245 } 244 246 … … 251 253 void tcp_conn_delref(tcp_conn_t *conn) 252 254 { 253 log_msg(LOG_DEFAULT, LVL_DEBUG2, "%s: tcp_conn_delref(%p) before=%zu",254 conn->name, conn , atomic_get(&conn->refcnt));255 256 if ( atomic_predec(&conn->refcnt) == 0)255 log_msg(LOG_DEFAULT, LVL_DEBUG2, "%s: tcp_conn_delref(%p)", 256 conn->name, conn); 257 258 if (refcount_down(&conn->refcnt)) 257 259 tcp_conn_free(conn); 258 260 }
Note:
See TracChangeset
for help on using the changeset viewer.