summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/globals.c
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src/globals.c')
-rw-r--r--libglusterfs/src/globals.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/libglusterfs/src/globals.c b/libglusterfs/src/globals.c
index c0040db1448..e845b3dcb66 100644
--- a/libglusterfs/src/globals.c
+++ b/libglusterfs/src/globals.c
@@ -267,6 +267,45 @@ glusterfs_central_log_flag_unset ()
}
+
+/* SYNCTASK */
+
+static pthread_key_t synctask_key;
+
+
+int
+synctask_init ()
+{
+ int ret = 0;
+
+ ret = pthread_key_create (&synctask_key, NULL);
+
+ return ret;
+}
+
+
+void *
+synctask_get ()
+{
+ void *synctask = NULL;
+
+ synctask = pthread_getspecific (synctask_key);
+
+ return synctask;
+}
+
+
+int
+synctask_set (void *synctask)
+{
+ int ret = 0;
+
+ pthread_setspecific (synctask_key, synctask);
+
+ return ret;
+}
+
+
int
glusterfs_globals_init ()
{
@@ -288,6 +327,10 @@ glusterfs_globals_init ()
gf_mem_acct_enable_set ();
+ ret = synctask_init ();
+ if (ret)
+ goto out;
+
out:
return ret;
}