aboutsummaryrefslogtreecommitdiff
path: root/src/protocol/pair
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2016-12-22 15:23:21 -0800
committerGarrett D'Amore <garrett@damore.org>2016-12-22 15:23:21 -0800
commit934c1316ae47754a2e368c65228c3cbfe552680f (patch)
treee81c4d2854df83e3d908c9269dd35c0600fa6acb /src/protocol/pair
parentee969ad99dc1e07e1c38876223e7aed13463b121 (diff)
downloadnng-934c1316ae47754a2e368c65228c3cbfe552680f.tar.gz
nng-934c1316ae47754a2e368c65228c3cbfe552680f.tar.bz2
nng-934c1316ae47754a2e368c65228c3cbfe552680f.zip
Inline locks (fewer allocs), simpler absolute times for wakeups. nn_sock_recv.
Diffstat (limited to 'src/protocol/pair')
-rw-r--r--src/protocol/pair/pair.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/protocol/pair/pair.c b/src/protocol/pair/pair.c
index 9523ca84..364a72fa 100644
--- a/src/protocol/pair/pair.c
+++ b/src/protocol/pair/pair.c
@@ -33,8 +33,8 @@ typedef struct nni_pair_pipe {
nni_pipe * pipe;
nni_pair_sock * pair;
int good;
- nni_thread_t sthr;
- nni_thread_t rthr;
+ nni_thread * sthr;
+ nni_thread * rthr;
int sigclose;
} nni_pair_pipe;
@@ -162,8 +162,8 @@ nni_pair_sender(void *arg)
{
nni_pair_pipe *pp = arg;
nni_pair_sock *pair = pp->pair;
- nni_msgqueue_t uwq = pair->uwq;
- nni_msgqueue_t urq = pair->urq;
+ nni_msgqueue *uwq = pair->uwq;
+ nni_msgqueue *urq = pair->urq;
nni_pipe *pipe = pp->pipe;
nni_msg *msg;
int rv;
@@ -177,7 +177,7 @@ nni_pair_sender(void *arg)
for (;;) {
- rv = nni_msgqueue_get_sig(uwq, &msg, -1, &pp->sigclose);
+ rv = nni_msgqueue_get_sig(uwq, &msg, &pp->sigclose);
if (rv != 0) {
break;
}
@@ -198,8 +198,8 @@ nni_pair_receiver(void *arg)
{
nni_pair_pipe *pp = arg;
nni_pair_sock *pair = pp->pair;
- nni_msgqueue_t urq = pair->urq;
- nni_msgqueue_t uwq = pair->uwq;
+ nni_msgqueue *urq = pair->urq;
+ nni_msgqueue *uwq = pair->uwq;
nni_pipe *pipe = pp->pipe;
nni_msg *msg;
int rv;
@@ -216,7 +216,7 @@ nni_pair_receiver(void *arg)
if (rv != 0) {
break;
}
- rv = nni_msgqueue_put_sig(urq, msg, -1, &pp->sigclose);
+ rv = nni_msgqueue_put_sig(urq, msg, &pp->sigclose);
if (rv != 0) {
nni_msg_free(msg);
break;
@@ -227,6 +227,7 @@ nni_pair_receiver(void *arg)
nni_socket_rem_pipe(pair->sock, pipe);
}
+
// TODO: probably we could replace these with NULL, since we have no
// protocol specific options?
static int