From 183bd7e02c81bc09c17c6f4c0d3883d4d45221fc Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Tue, 11 Jul 2017 10:10:39 -0700 Subject: Eliminate the separate wrapping structure for platform mtx and cv. --- src/core/thread.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/core/thread.c') diff --git a/src/core/thread.c b/src/core/thread.c index e603e32b..3cfdd83f 100644 --- a/src/core/thread.c +++ b/src/core/thread.c @@ -12,43 +12,43 @@ int nni_mtx_init(nni_mtx *mtx) { - return (nni_plat_mtx_init(&mtx->mtx)); + return (nni_plat_mtx_init(mtx)); } void nni_mtx_fini(nni_mtx *mtx) { - nni_plat_mtx_fini(&mtx->mtx); + nni_plat_mtx_fini(mtx); } void nni_mtx_lock(nni_mtx *mtx) { - nni_plat_mtx_lock(&mtx->mtx); + nni_plat_mtx_lock(mtx); } void nni_mtx_unlock(nni_mtx *mtx) { - nni_plat_mtx_unlock(&mtx->mtx); + nni_plat_mtx_unlock(mtx); } int nni_cv_init(nni_cv *cv, nni_mtx *mtx) { - return (nni_plat_cv_init(&cv->cv, &mtx->mtx)); + return (nni_plat_cv_init(cv, mtx)); } void nni_cv_fini(nni_cv *cv) { - nni_plat_cv_fini(&cv->cv); + nni_plat_cv_fini(cv); } void nni_cv_wait(nni_cv *cv) { - nni_plat_cv_wait(&cv->cv); + nni_plat_cv_wait(cv); } int @@ -57,20 +57,20 @@ nni_cv_until(nni_cv *cv, nni_time until) // Some special cases for times. Catching these here means that // platforms can assume a valid time is presented to them. if (until == NNI_TIME_NEVER) { - nni_plat_cv_wait(&cv->cv); + nni_plat_cv_wait(cv); return (0); } if (until == NNI_TIME_ZERO) { return (NNG_EAGAIN); } - return (nni_plat_cv_until(&cv->cv, until)); + return (nni_plat_cv_until(cv, until)); } void nni_cv_wake(nni_cv *cv) { - nni_plat_cv_wake(&cv->cv); + nni_plat_cv_wake(cv); } static void -- cgit v1.2.3-70-g09d2