summaryrefslogtreecommitdiff
path: root/mysys/my_open.c
diff options
context:
space:
mode:
Diffstat (limited to 'mysys/my_open.c')
-rw-r--r--mysys/my_open.c11
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));