Skip to content

Commit 8ab67a0

Browse files
committed
Correctly reset flag in cv_reset()
1 parent e7544f7 commit 8ab67a0

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#### Updates
44

5+
* `cv_reset()` now correctly resets the flag in the case a flag event has already been registered with `pipe_notify()`.
56
* The previous `listen()` and `dial()` argument `error`, removed in v1.6.0, is now defunct.
67
* The previous `serial_config()` argument `vec`, unutilised since v1.6.0, is removed.
78

src/sync.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ SEXP rnng_cv_reset(SEXP cvar) {
360360
nng_mtx *mtx = ncv->mtx;
361361

362362
nng_mtx_lock(mtx);
363-
ncv->flag = 0;
363+
ncv->flag = ncv->flag < 0;
364364
ncv->condition = 0;
365365
nng_mtx_unlock(mtx);
366366

0 commit comments

Comments
 (0)