Skip to content

Commit 930e5ce

Browse files
committed
change ack ordering
1 parent 3a2a9b2 commit 930e5ce

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: nanonext
22
Type: Package
33
Title: NNG (Nanomsg Next Gen) Lightweight Messaging Library
4-
Version: 0.10.2.9021
4+
Version: 0.10.2.9022
55
Description: R binding for NNG (Nanomsg Next Gen), a successor to ZeroMQ. NNG is
66
a socket library implementing 'Scalability Protocols', a reliable,
77
high-performance standard for common communications patterns including

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# nanonext 0.10.2.9021 (development)
1+
# nanonext 0.10.2.9022 (development)
22

33
#### New Features
44

src/aio.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,13 @@ static void raio_complete_ack(void *arg) {
252252
if (res == 0)
253253
raio->data = nng_aio_get_msg(raio->aio);
254254

255-
nng_msg *msg;
256-
257255
#if NNG_MAJOR_VERSION == 1 && NNG_MINOR_VERSION < 6
258256

257+
nng_mtx_lock(shr_mtx);
258+
raio->result = res - !res;
259+
nng_mtx_unlock(shr_mtx);
260+
261+
nng_msg *msg;
259262
if (nng_msg_alloc(&msg, 0) == 0) {
260263
nng_aio *aio;
261264
if (nng_aio_alloc(&aio, NULL, NULL) == 0) {
@@ -271,17 +274,14 @@ static void raio_complete_ack(void *arg) {
271274
}
272275
}
273276

274-
nng_mtx_lock(shr_mtx);
275-
raio->result = res - !res;
276-
nng_mtx_unlock(shr_mtx);
277-
278277
#else
279278

279+
raio->result = res - !res;
280+
nng_msg *msg;
280281
if (nng_msg_alloc(&msg, 0) == 0) {
281282
if (nng_ctx_sendmsg(*ctx, msg, NNG_FLAG_NONBLOCK))
282283
nng_msg_free(msg);
283284
}
284-
raio->result = res - !res;
285285

286286
#endif
287287

0 commit comments

Comments
 (0)