aboutsummaryrefslogtreecommitdiff
path: root/src/core/thread.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-07-11 10:10:39 -0700
committerGarrett D'Amore <garrett@damore.org>2017-07-11 10:10:39 -0700
commit183bd7e02c81bc09c17c6f4c0d3883d4d45221fc (patch)
tree4954056e769d8761eff75143b0cfc44050be0198 /src/core/thread.c
parent910564d2f67eb81a07c0c6b2af0fc0878137308b (diff)
downloadnng-183bd7e02c81bc09c17c6f4c0d3883d4d45221fc.tar.gz
nng-183bd7e02c81bc09c17c6f4c0d3883d4d45221fc.tar.bz2
nng-183bd7e02c81bc09c17c6f4c0d3883d4d45221fc.zip
Eliminate the separate wrapping structure for platform mtx and cv.
Diffstat (limited to 'src/core/thread.c')
-rw-r--r--src/core/thread.c20
1 files changed, 10 insertions, 10 deletions
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