aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/socket.c23
-rw-r--r--src/core/socket.h1
2 files changed, 0 insertions, 24 deletions
diff --git a/src/core/socket.c b/src/core/socket.c
index e41e28a4..5beffaf0 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -421,16 +421,6 @@ nni_sock_open(nni_sock **sockp, uint16_t pnum)
goto fail;
}
- // NB: If worker functions are null, then the thread initialization
- // turns into a NOP, and no actual thread will be started.
- for (i = 0; i < NNI_MAXWORKERS; i++) {
- nni_worker fn = sops->sock_worker[i];
- rv = nni_thr_init(&sock->s_worker_thr[i], fn, sock->s_data);
- if (rv != 0) {
- goto fail;
- }
- }
-
// XXX: This kills performance. Look at moving this to
// be conditional - if nobody has callbacks because their code is
// also threaded, then we don't need to jump through these hoops.
@@ -443,10 +433,6 @@ nni_sock_open(nni_sock **sockp, uint16_t pnum)
goto fail;
}
- for (i = 0; i < NNI_MAXWORKERS; i++) {
- nni_thr_run(&sock->s_worker_thr[i]);
- }
-
sops->sock_open(sock->s_data);
nni_thr_run(&sock->s_notifier);
@@ -457,9 +443,6 @@ fail:
sock->s_sock_ops.sock_fini(sock->s_data);
// And we need to clean up *our* state.
- for (i = 0; i < NNI_MAXWORKERS; i++) {
- nni_thr_fini(&sock->s_worker_thr[i]);
- }
if (sock->s_id != 0) {
nni_mtx_lock(nni_idlock);
nni_idhash_remove(nni_sockets, sock->s_id);
@@ -572,9 +555,6 @@ nni_sock_shutdown(nni_sock *sock)
nni_mtx_unlock(&sock->s_mx);
// Wait for the threads to exit.
- for (i = 0; i < NNI_MAXWORKERS; i++) {
- nni_thr_wait(&sock->s_worker_thr[i]);
- }
nni_thr_wait(&sock->s_notifier);
// At this point, there are no threads blocked inside of us
@@ -632,9 +612,6 @@ nni_sock_close(nni_sock *sock)
sock->s_sock_ops.sock_fini(sock->s_data);
// And we need to clean up *our* state.
- for (i = 0; i < NNI_MAXWORKERS; i++) {
- nni_thr_fini(&sock->s_worker_thr[i]);
- }
while ((notify = nni_list_first(&sock->s_notify)) != NULL) {
nni_list_remove(&sock->s_notify, notify);
NNI_FREE_STRUCT(notify);
diff --git a/src/core/socket.h b/src/core/socket.h
index 6fe4117a..6a608d0a 100644
--- a/src/core/socket.h
+++ b/src/core/socket.h
@@ -52,7 +52,6 @@ struct nni_socket {
size_t s_rcvmaxsz; // maximum receive size
nni_thr s_notifier;
- nni_thr s_worker_thr[NNI_MAXWORKERS];
int s_ep_pend; // EP dial/listen in progress
int s_closing; // Socket is closing