Commit 10cdf523 authored by Sergey Vojtovich's avatar Sergey Vojtovich

my_file_opened to my_atomic

parent 5876ed9e
...@@ -222,7 +222,8 @@ FILE *my_fdopen(File Filedes, const char *name, int Flags, myf MyFlags) ...@@ -222,7 +222,8 @@ FILE *my_fdopen(File Filedes, const char *name, int Flags, myf MyFlags)
{ {
if (my_file_info[Filedes].type != UNOPEN) if (my_file_info[Filedes].type != UNOPEN)
{ {
thread_safe_decrement32(&my_file_opened); /* File is opened with my_open ! */ /* File is opened with my_open ! */
my_atomic_add32_explicit(&my_file_opened, -1, MY_MEMORY_ORDER_RELAXED);
} }
else else
{ {
......
...@@ -105,7 +105,7 @@ int my_close(File fd, myf MyFlags) ...@@ -105,7 +105,7 @@ int my_close(File fd, myf MyFlags)
{ {
my_free(name); my_free(name);
} }
thread_safe_decrement32(&my_file_opened); my_atomic_add32_explicit(&my_file_opened, -1, MY_MEMORY_ORDER_RELAXED);
DBUG_RETURN(err); DBUG_RETURN(err);
} /* my_close */ } /* my_close */
...@@ -133,7 +133,7 @@ File my_register_filename(File fd, const char *FileName, enum file_type ...@@ -133,7 +133,7 @@ File my_register_filename(File fd, const char *FileName, enum file_type
DBUG_ENTER("my_register_filename"); DBUG_ENTER("my_register_filename");
if ((int) fd >= MY_FILE_MIN) if ((int) fd >= MY_FILE_MIN)
{ {
thread_safe_increment32(&my_file_opened); my_atomic_add32_explicit(&my_file_opened, 1, MY_MEMORY_ORDER_RELAXED);
if ((uint) fd >= my_file_limit) if ((uint) fd >= my_file_limit)
DBUG_RETURN(fd); DBUG_RETURN(fd);
my_file_info[fd].name = (char*) my_strdup(FileName, MyFlags); my_file_info[fd].name = (char*) my_strdup(FileName, MyFlags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment