diff options
| author | Garrett D'Amore <garrett@damore.org> | 2020-02-05 22:08:59 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2020-02-05 22:08:59 -0800 |
| commit | 291496f21f9daf1a0f64871043a5a7bc9180b1ad (patch) | |
| tree | bb3bbd991bcca3ed74d94b48d150cadef0660662 /src/platform | |
| parent | 1ab680facd88fc3e63d5a82256373d6b517fbe8d (diff) | |
| download | nng-291496f21f9daf1a0f64871043a5a7bc9180b1ad.tar.gz nng-291496f21f9daf1a0f64871043a5a7bc9180b1ad.tar.bz2 nng-291496f21f9daf1a0f64871043a5a7bc9180b1ad.zip | |
more compile fixes for legacy atomics
Diffstat (limited to 'src/platform')
| -rw-r--r-- | src/platform/posix/posix_atomic.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/platform/posix/posix_atomic.c b/src/platform/posix/posix_atomic.c index ecaf5461..57ef709a 100644 --- a/src/platform/posix/posix_atomic.c +++ b/src/platform/posix/posix_atomic.c @@ -211,7 +211,7 @@ nni_atomic_set_bool(nni_atomic_bool *b, bool n) pthread_mutex_unlock(&plat_atomic_lock); } -void +bool nni_atomic_get_bool(nni_atomic_bool *b) { bool v; @@ -221,7 +221,7 @@ nni_atomic_get_bool(nni_atomic_bool *b) return (v); } -void +bool nni_atomic_swap_bool(nni_atomic_bool *b, bool n) { bool v; @@ -324,7 +324,9 @@ nni_atomic_cas64(nni_atomic_u64 *v, uint64_t comp, uint64_t new) void nni_atomic_init(nni_atomic_int *v) { - atomic_init(&v->v, 0); + pthread_mutex_lock(&plat_atomic_lock); + v->v = 0; + pthread_mutex_unlock(&plat_atomic_lock); } void |
