From 50ec02d5320d3cde101ad46844f3bec7304eda35 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 5 Jan 2025 08:43:00 -0800 Subject: pthreads: avoid double indirection for cv mutex --- src/platform/posix/posix_impl.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/platform/posix/posix_impl.h') diff --git a/src/platform/posix/posix_impl.h b/src/platform/posix/posix_impl.h index a0bb3217..4cac6beb 100644 --- a/src/platform/posix/posix_impl.h +++ b/src/platform/posix/posix_impl.h @@ -77,16 +77,16 @@ struct nni_rwlock { // No static form of CV initialization because of the need to use // attributes to set the clock type. struct nni_plat_cv { - pthread_cond_t cv; - nni_plat_mtx *mtx; + pthread_cond_t cv; + pthread_mutex_t *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 \ +#define NNI_CV_INITIALIZER(mxp) \ + { \ + .mtx = &((mxp)->mtx), .cv = PTHREAD_COND_INITIALIZER \ } struct nni_plat_thr { -- cgit v1.2.3-70-g09d2