1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

WL#2360 Performance schema

Part II, engines instrumentation
This commit is contained in:
Marc Alff
2009-12-04 18:26:15 -07:00
parent 34436edb4d
commit 57fd11788e
58 changed files with 1033 additions and 576 deletions

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2000-2006 MySQL AB
/* Copyright (C) 2000-2006 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
@ -32,7 +32,7 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
if (!create_info->internal_table)
{
pthread_mutex_lock(&THR_LOCK_heap);
mysql_mutex_lock(&THR_LOCK_heap);
if ((share= hp_find_named_heap(name)) && share->open_count == 0)
{
hp_free(share);
@ -194,7 +194,8 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
}
#ifdef THREAD
thr_lock_init(&share->lock);
pthread_mutex_init(&share->intern_lock,MY_MUTEX_INIT_FAST);
mysql_mutex_init(hp_key_mutex_HP_SHARE_intern_lock,
&share->intern_lock, MY_MUTEX_INIT_FAST);
#endif
if (!create_info->internal_table)
{
@ -205,14 +206,14 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
share->delete_on_close= 1;
}
if (!create_info->internal_table)
pthread_mutex_unlock(&THR_LOCK_heap);
mysql_mutex_unlock(&THR_LOCK_heap);
*res= share;
DBUG_RETURN(0);
err:
if (!create_info->internal_table)
pthread_mutex_unlock(&THR_LOCK_heap);
mysql_mutex_unlock(&THR_LOCK_heap);
DBUG_RETURN(1);
} /* heap_create */
@ -266,7 +267,7 @@ int heap_delete_table(const char *name)
reg1 HP_SHARE *share;
DBUG_ENTER("heap_delete_table");
pthread_mutex_lock(&THR_LOCK_heap);
mysql_mutex_lock(&THR_LOCK_heap);
if ((share= hp_find_named_heap(name)))
{
heap_try_free(share);
@ -276,7 +277,7 @@ int heap_delete_table(const char *name)
{
result= my_errno=ENOENT;
}
pthread_mutex_unlock(&THR_LOCK_heap);
mysql_mutex_unlock(&THR_LOCK_heap);
DBUG_RETURN(result);
}
@ -284,9 +285,9 @@ int heap_delete_table(const char *name)
void heap_drop_table(HP_INFO *info)
{
DBUG_ENTER("heap_drop_table");
pthread_mutex_lock(&THR_LOCK_heap);
mysql_mutex_lock(&THR_LOCK_heap);
heap_try_free(info->s);
pthread_mutex_unlock(&THR_LOCK_heap);
mysql_mutex_unlock(&THR_LOCK_heap);
DBUG_VOID_RETURN;
}
@ -298,7 +299,7 @@ void hp_free(HP_SHARE *share)
hp_clear(share); /* Remove blocks from memory */
#ifdef THREAD
thr_lock_delete(&share->lock);
pthread_mutex_destroy(&share->intern_lock);
mysql_mutex_destroy(&share->intern_lock);
#endif
my_free((uchar*) share->name, MYF(0));
my_free((uchar*) share, MYF(0));