diff options
author | Anand Avati <avati@redhat.com> | 2013-04-22 04:35:03 -0700 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2013-05-04 00:33:01 -0700 |
commit | 83cedcd9be2676e63b1be72ecaf3316a781773cb (patch) | |
tree | 70c3bd94e31db88f86ae78cd1efa4f031046ef1d /xlators/mgmt | |
parent | 54b9cd3df357ac196af17f53282b3b1975dd4fb9 (diff) |
synctask: implement barriers around yield, not the other way
In the current implementation, barriers are in the core of the
syncprocessors. Wake()s are treated as syncbarrier wake. This
is however delicate, as spurious wake()s of the synctask can
mess up the accounting of the barrier and waking it prematurely.
The fix is to keep yield() and wake() as the basic primitives,
and implement barriers as an object impelemented on top of these
primitives. This way, only an explicit barrier_wake() gets
counted towards the barrier accounting, and spurious wakes
will be truly safe.
Change-Id: I8087f0f446113e5b2d0853431c0354335ccda076
BUG: 948686
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/4921
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-syncop.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.c b/xlators/mgmt/glusterd/src/glusterd-syncop.c index f39694b79c1..3cf3b5ddaa0 100644 --- a/xlators/mgmt/glusterd/src/glusterd-syncop.c +++ b/xlators/mgmt/glusterd/src/glusterd-syncop.c @@ -26,6 +26,8 @@ gd_synctask_barrier_wait (struct syncargs *args, int count) synclock_unlock (&conf->big_lock); synctask_barrier_wait (args, count); synclock_lock (&conf->big_lock); + + syncbarrier_destroy (&args->barrier); } static void |