summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/syncop.h
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kparthas@redhat.com>2013-05-22 00:18:04 +0530
committerAnand Avati <avati@redhat.com>2013-05-21 15:59:55 -0700
commit16b5ec67120e198fb320e13ade9e31d3761b0932 (patch)
tree55e367af913ce14b79478a3a6c82c505f1af4176 /libglusterfs/src/syncop.h
parent2eed9c78569311e4fa75735d67e8838cc79109a7 (diff)
syncop: synctask shouldn't yawn, it could miss a 'wake'
Change-Id: I7731fd33ca0c925cc52f8d105275b44fc625a1e2 BUG: 948686 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/5058 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'libglusterfs/src/syncop.h')
-rw-r--r--libglusterfs/src/syncop.h15
1 files changed, 6 insertions, 9 deletions
diff --git a/libglusterfs/src/syncop.h b/libglusterfs/src/syncop.h
index 5c439f85d3d..f05db9943a2 100644
--- a/libglusterfs/src/syncop.h
+++ b/libglusterfs/src/syncop.h
@@ -148,14 +148,12 @@ struct syncargs {
#define __yawn(args) do { \
- args->task = synctask_get (); \
- if (args->task) { \
- synctask_yawn (args->task); \
- } else { \
- pthread_mutex_init (&args->mutex, NULL); \
- pthread_cond_init (&args->cond, NULL); \
- args->done = 0; \
- } \
+ args->task = synctask_get (); \
+ if (args->task) \
+ break; \
+ pthread_mutex_init (&args->mutex, NULL); \
+ pthread_cond_init (&args->cond, NULL); \
+ args->done = 0; \
} while (0)
@@ -228,7 +226,6 @@ void syncenv_scale (struct syncenv *env);
int synctask_new (struct syncenv *, synctask_fn_t, synctask_cbk_t, call_frame_t* frame, void *);
void synctask_wake (struct synctask *task);
void synctask_yield (struct synctask *task);
-void synctask_yawn (struct synctask *task);
void synctask_waitfor (struct synctask *task, int count);
#define synctask_barrier_init(args) syncbarrier_init (&args->barrier)