diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2019-05-19 20:55:37 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2019-05-19 20:55:37 +0200 |
commit | c07325f932abef2032b2e56532f6cb615e2a1161 (patch) | |
tree | 754ca158e45ebc014e5cbeaf4c3e7581f9575d76 /mysys/my_open.c | |
parent | 7f8187bc432f79afe4c0549d68845a68e6c159ab (diff) | |
parent | 2ae83affef5a4d89f38272db31a400f968279a7a (diff) | |
download | mariadb-git-c07325f932abef2032b2e56532f6cb615e2a1161.tar.gz |
Merge branch '10.3' into 10.4
Diffstat (limited to 'mysys/my_open.c')
-rw-r--r-- | mysys/my_open.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/mysys/my_open.c b/mysys/my_open.c index 37cde868b61..04324d13d71 100644 --- a/mysys/my_open.c +++ b/mysys/my_open.c @@ -11,7 +11,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */ #include "mysys_priv.h" #include "mysys_err.h" @@ -105,7 +105,7 @@ int my_close(File fd, myf MyFlags) { my_free(name); } - statistic_decrement(my_file_opened, &THR_LOCK_open); + thread_safe_decrement32(&my_file_opened); DBUG_RETURN(err); } /* my_close */ @@ -133,13 +133,10 @@ File my_register_filename(File fd, const char *FileName, enum file_type DBUG_ENTER("my_register_filename"); if ((int) fd >= MY_FILE_MIN) { + thread_safe_increment32(&my_file_opened); if ((uint) fd >= my_file_limit) - { - statistic_increment(my_file_opened,&THR_LOCK_open); - DBUG_RETURN(fd); /* safeguard */ - } + DBUG_RETURN(fd); my_file_info[fd].name = (char*) my_strdup(FileName, MyFlags); - statistic_increment(my_file_opened,&THR_LOCK_open); statistic_increment(my_file_total_opened,&THR_LOCK_open); my_file_info[fd].type = type_of_file; DBUG_PRINT("exit",("fd: %d",fd)); |