diff options
| author | Garrett D'Amore <garrett@damore.org> | 2021-12-05 23:39:22 -0500 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2021-12-05 23:39:22 -0500 |
| commit | 21528dfe0998d056222191a4abe53d8d9f1286e3 (patch) | |
| tree | 3231c744883aa89af32e75f2d775e1cc8b63c1f8 /src/platform/posix/posix_impl.h | |
| parent | c9bbe8eb574fe10ff16cc71a23fcc9b31fb8ed04 (diff) | |
| download | nng-21528dfe0998d056222191a4abe53d8d9f1286e3.tar.gz nng-21528dfe0998d056222191a4abe53d8d9f1286e3.tar.bz2 nng-21528dfe0998d056222191a4abe53d8d9f1286e3.zip | |
Static condvar initialization.
Diffstat (limited to 'src/platform/posix/posix_impl.h')
| -rw-r--r-- | src/platform/posix/posix_impl.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/platform/posix/posix_impl.h b/src/platform/posix/posix_impl.h index 97924a45..0ee7cb38 100644 --- a/src/platform/posix/posix_impl.h +++ b/src/platform/posix/posix_impl.h @@ -73,6 +73,11 @@ struct nni_plat_cv { nni_plat_mtx *mtx; }; +// NOTE: condition variables initialized with this should *NOT* +// be used with nni_cv_until -- the clock attributes are not passed +// and the wake-up times will not be correct. +#define NNI_CV_INITIALIZER(mxp) { .mtx = mxp, .cv = PTHREAD_COND_INITIALIZER } + struct nni_plat_thr { pthread_t tid; void (*func)(void *); |
