summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/glusterfs/mem-pool.h
diff options
context:
space:
mode:
authorXavi Hernandez <xhernandez@redhat.com>2019-03-05 18:58:20 +0100
committerAmar Tumballi <amarts@redhat.com>2019-04-24 03:26:48 +0000
commitd8eadde7d498939c746ea8ddd9dc70a1029b4070 (patch)
treed30e0f2c7aa921eef5fbb2fd784a27409add674e /libglusterfs/src/glusterfs/mem-pool.h
parent87ae36774a0e5a8af9330cf651d93f5cc84cb515 (diff)
core: avoid dynamic TLS allocation when possible
Some interdependencies between logging and memory management functions make it impossible to use the logging framework before initializing memory subsystem because they both depend on Thread Local Storage allocated through pthread_key_create() during initialization. This causes a crash when we try to log something very early in the initialization phase. To prevent this, several dynamically allocated TLS structures have been replaced by static TLS reserved at compile time using '__thread' keyword. This also reduces the number of error sources, making initialization simpler. Updates: bz#1193929 Change-Id: I8ea2e072411e30790d50084b6b7e909c7bb01d50 Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
Diffstat (limited to 'libglusterfs/src/glusterfs/mem-pool.h')
-rw-r--r--libglusterfs/src/glusterfs/mem-pool.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/libglusterfs/src/glusterfs/mem-pool.h b/libglusterfs/src/glusterfs/mem-pool.h
index 1f2b1a9a5c4..95579509866 100644
--- a/libglusterfs/src/glusterfs/mem-pool.h
+++ b/libglusterfs/src/glusterfs/mem-pool.h
@@ -279,9 +279,7 @@ struct mem_pool_shared {
};
void
-mem_pools_init_early(void); /* basic initialization of memory pools */
-void
-mem_pools_init_late(void); /* start the pool_sweeper thread */
+mem_pools_init(void); /* start the pool_sweeper thread */
void
mem_pools_fini(void); /* cleanup memory pools */
@@ -306,6 +304,9 @@ void
mem_pool_destroy(struct mem_pool *pool);
void
+mem_pool_thread_destructor(void);
+
+void
gf_mem_acct_enable_set(void *ctx);
#endif /* _MEM_POOL_H */