summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlexey Kopytov <Alexey.Kopytov@sun.com>2009-02-27 11:26:06 +0200
committerAlexey Kopytov <Alexey.Kopytov@sun.com>2009-02-27 11:26:06 +0200
commit752cbab9a4c553871cab9e5fdb8968019617cc28 (patch)
treeede7660d1ce7a18f7267f3cd27a0fff7cbcc8675 /include
parentd16c7dd1829e7dcfa2ef119fa04d090981936d09 (diff)
downloadmariadb-git-752cbab9a4c553871cab9e5fdb8968019617cc28.tar.gz
Fix for bug #40552: Race condition around default_directories
in load_defaults() load_defaults(), my_search_option_files() and my_print_default_files() utilized a global variable containing a pointer to thread local memory. This could lead to race conditions when those functions were called with high concurrency. Fixed by changing the interface of the said functions to avoid the necessity for using a global variable. Since we cannot change load_defaults() prototype for API compatibility reasons, it was renamed my_load_defaults(). Now load_defaults() is a thread-unsafe wrapper around a thread-safe version, my_load_defaults().
Diffstat (limited to 'include')
-rw-r--r--include/my_sys.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/my_sys.h b/include/my_sys.h
index 5335b65822f..180bfe0f07d 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -842,14 +842,17 @@ extern void *memdup_root(MEM_ROOT *root,const void *str, size_t len);
extern int get_defaults_options(int argc, char **argv,
char **defaults, char **extra_defaults,
char **group_suffix);
+extern int my_load_defaults(const char *conf_file, const char **groups,
+ int *argc, char ***argv, const char ***);
extern int load_defaults(const char *conf_file, const char **groups,
- int *argc, char ***argv);
+ int *argc, char ***argv);
extern int modify_defaults_file(const char *file_location, const char *option,
const char *option_value,
const char *section_name, int remove_option);
extern int my_search_option_files(const char *conf_file, int *argc,
char ***argv, uint *args_used,
- Process_option_func func, void *func_ctx);
+ Process_option_func func, void *func_ctx,
+ const char **default_directories);
extern void free_defaults(char **argv);
extern void my_print_default_files(const char *conf_file);
extern void print_defaults(const char *conf_file, const char **groups);