diff options
author | Humble Devassy Chirammal <hchiramm@redhat.com> | 2015-05-18 17:37:14 +0530 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2015-06-22 02:36:24 -0700 |
commit | 5afaa6e64f46a32f2b86512236677066adc36510 (patch) | |
tree | 43317b98f38f848496b9a6e106309b641d4a760f /extras | |
parent | db4beb00c6dfb45367b8869fcaa813c83f1aa8eb (diff) |
libgfapi: introduce bit flags for pthread mutex and cond variables
At present stage, the initialization and destroy of conditional
and mutex variables of glfs struct happen in different places and
there is no uniform way of destroying these variables incase
there is a failure when initializing these. The fs mutex and
conditional variables are getting destroyed from glfs_free_from_ctx().
However this destroy is not done by a conditional check inside destroy
function. By introducing bit flags in glfs object, we can make use of the
same (if there is a failure in initialization) in glfs_fini()
which is evolving as one and only function to free fs and ctx resources.
This patch introduce the flags field and set the flags according
to the initialization flow of the mutex and conditional variables
of struct glfs members. Without this patch we are compelled to use
the goto lables and other hacks in init functions to make sure
the resources are freed if there is an error path.
Change-Id: I86e2719fb7ce437419a05699b4f06c14b02d0e69
BUG: 1233651
Signed-off-by: Humble Devassy Chirammal <hchiramm@redhat.com>
Signed-off-by: Poornima G <pgurusid@redhat.com>
Reviewed-on: http://review.gluster.org/10120
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
(cherry picked from commit bc858473db1e1091b15d3f3d69ac6ba5d20b58e7)
Reviewed-on: http://review.gluster.org/10971
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'extras')
0 files changed, 0 insertions, 0 deletions