This is an automated email from the git hooks/post-receive script.
firstyear pushed a commit to branch master
in repository 389-ds-base.
commit b1b0574d2cdb012ab206999ed51f08d3340386ce
Author: William Brown <firstyear(a)redhat.com>
Date: Mon Mar 13 13:29:43 2017 +1000
Ticket 49164 - Change NS to acq-rel semantics for atomics
Bug Description: We were using seq_cst to guarantee our operations
as a poc. Changing to acq/rel allows us the same guarantees, but
with less overheads.
Fix Description: Change the barrier type.
https://gcc.gnu.org/wiki/Atomic/GCCMM/AtomicSync
https://pagure.io/389-ds-base/issue/49164
Author: wibrown
Review by: mreynolds (Thanks!)
---
src/nunc-stans/ns/ns_thrpool.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/nunc-stans/ns/ns_thrpool.c b/src/nunc-stans/ns/ns_thrpool.c
index 10791ee..0582700 100644
--- a/src/nunc-stans/ns/ns_thrpool.c
+++ b/src/nunc-stans/ns/ns_thrpool.c
@@ -166,7 +166,7 @@ int32_t
ns_thrpool_is_shutdown(struct ns_thrpool_t *tp)
{
int32_t result = 0;
- __atomic_load(&(tp->shutdown), &result, __ATOMIC_SEQ_CST);
+ __atomic_load(&(tp->shutdown), &result, __ATOMIC_ACQUIRE);
return result;
}
@@ -174,7 +174,7 @@ int32_t
ns_thrpool_is_event_shutdown(struct ns_thrpool_t *tp)
{
int32_t result = 0;
- __atomic_load(&(tp->shutdown_event_loop), &result, __ATOMIC_SEQ_CST);
+ __atomic_load(&(tp->shutdown_event_loop), &result, __ATOMIC_ACQUIRE);
return result;
}
@@ -1399,7 +1399,7 @@ ns_thrpool_destroy(struct ns_thrpool_t *tp)
#endif
if (tp) {
/* Set the flag to shutdown the event loop. */
- __atomic_add_fetch(&(tp->shutdown_event_loop), 1, __ATOMIC_SEQ_CST);
+ __atomic_add_fetch(&(tp->shutdown_event_loop), 1, __ATOMIC_RELEASE);
/* Finish the event queue wakeup job. This has the
* side effect of waking up the event loop thread, which
@@ -1488,7 +1488,7 @@ ns_thrpool_shutdown(struct ns_thrpool_t *tp)
}
/* Set the shutdown flag. This will cause the worker
* threads to exit after they finish all remaining work. */
- __atomic_add_fetch(&(tp->shutdown), 1, __ATOMIC_SEQ_CST);
+ __atomic_add_fetch(&(tp->shutdown), 1, __ATOMIC_RELEASE);
/* Wake up the idle worker threads so they can exit. */
/* Do we need this to be run in conjuction with our thread join loop incase threads
are still active? */
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.