Skip to content

Commit 3f50870

Browse files
committed
session server BUGFIX lock config wrlock
1 parent 47c4f38 commit 3f50870

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/session_server.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,17 @@ nc_server_ch_set_dispatch_data(nc_server_ch_session_acquire_ctx_cb acquire_ctx_c
243243
{
244244
NC_CHECK_ARG_RET(NULL, acquire_ctx_cb, release_ctx_cb, new_session_cb, );
245245

246+
/* CONFIG WRITE LOCK */
247+
pthread_rwlock_wrlock(&server_opts.config_lock);
248+
246249
server_opts.ch_dispatch_data.acquire_ctx_cb = acquire_ctx_cb;
247250
server_opts.ch_dispatch_data.release_ctx_cb = release_ctx_cb;
248251
server_opts.ch_dispatch_data.ctx_cb_data = ctx_cb_data;
249252
server_opts.ch_dispatch_data.new_session_cb = new_session_cb;
250253
server_opts.ch_dispatch_data.new_session_cb_data = new_session_cb_data;
254+
255+
/* CONFIG WRITE UNLOCK */
256+
pthread_rwlock_unlock(&server_opts.config_lock);
251257
}
252258

253259
#endif

0 commit comments

Comments
 (0)