summaryrefslogtreecommitdiff
path: root/mysys/my_open.c
diff options
context:
space:
mode:
authorMarc Alff <marc.alff@sun.com>2009-12-09 20:19:51 -0700
committerMarc Alff <marc.alff@sun.com>2009-12-09 20:19:51 -0700
commitc082955f0676efe069f30384102ba7807b49dee6 (patch)
treecc0a038191d1969182d5dd108c891ee10a436cc0 /mysys/my_open.c
parent6fd3866c6c104f8bc991d71583e627ae6fabe0ab (diff)
downloadmariadb-git-c082955f0676efe069f30384102ba7807b49dee6.tar.gz
WL#2360 Performance schema
Part III: mysys instrumentation
Diffstat (limited to 'mysys/my_open.c')
-rw-r--r--mysys/my_open.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/mysys/my_open.c b/mysys/my_open.c
index 79a4da242f9..a50baf2c417 100644
--- a/mysys/my_open.c
+++ b/mysys/my_open.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -70,7 +70,7 @@ int my_close(File fd, myf MyFlags)
DBUG_ENTER("my_close");
DBUG_PRINT("my",("fd: %d MyFlags: %d",fd, MyFlags));
- pthread_mutex_lock(&THR_LOCK_open);
+ mysql_mutex_lock(&THR_LOCK_open);
#ifndef _WIN32
do
{
@@ -90,12 +90,12 @@ int my_close(File fd, myf MyFlags)
{
my_free(my_file_info[fd].name, MYF(0));
#if defined(THREAD) && !defined(HAVE_PREAD) && !defined(_WIN32)
- pthread_mutex_destroy(&my_file_info[fd].mutex);
+ mysql_mutex_destroy(&my_file_info[fd].mutex);
#endif
my_file_info[fd].type = UNOPEN;
}
my_file_opened--;
- pthread_mutex_unlock(&THR_LOCK_open);
+ mysql_mutex_unlock(&THR_LOCK_open);
DBUG_RETURN(err);
} /* my_close */
@@ -134,20 +134,21 @@ File my_register_filename(File fd, const char *FileName, enum file_type
}
else
{
- pthread_mutex_lock(&THR_LOCK_open);
+ mysql_mutex_lock(&THR_LOCK_open);
if ((my_file_info[fd].name = (char*) my_strdup(FileName,MyFlags)))
{
my_file_opened++;
my_file_total_opened++;
my_file_info[fd].type = type_of_file;
#if defined(THREAD) && !defined(HAVE_PREAD) && !defined(_WIN32)
- pthread_mutex_init(&my_file_info[fd].mutex,MY_MUTEX_INIT_FAST);
+ mysql_mutex_init(key_my_file_info_mutex, &my_file_info[fd].mutex,
+ MY_MUTEX_INIT_FAST);
#endif
- pthread_mutex_unlock(&THR_LOCK_open);
+ mysql_mutex_unlock(&THR_LOCK_open);
DBUG_PRINT("exit",("fd: %d",fd));
DBUG_RETURN(fd);
}
- pthread_mutex_unlock(&THR_LOCK_open);
+ mysql_mutex_unlock(&THR_LOCK_open);
my_errno= ENOMEM;
}
(void) my_close(fd, MyFlags);