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

Merge mysql.com:/home/my/mysql-4.1

into  mysql.com:/home/my/mysql-5.0
This commit is contained in:
monty@mysql.com
2005-07-28 17:09:54 +03:00
360 changed files with 846 additions and 175 deletions

View File

@ -4082,6 +4082,9 @@ void flush_tables()
The table will be closed (not stored in cache) by the current thread when
close_thread_tables() is called.
PREREQUISITES
Lock on LOCK_open()
RETURN
0 This thread now have exclusive access to this table and no other thread
can access the table until close_thread_tables() is called.
@ -4097,6 +4100,7 @@ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name,
bool result=0, signalled= 0;
DBUG_ENTER("remove_table_from_cache");
key_length=(uint) (strmov(strmov(key,db)+1,table_name)-key)+1;
for (;;)
{
@ -4154,15 +4158,12 @@ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name,
{
if (!(flags & RTFC_CHECK_KILLED_FLAG) || !thd->killed)
{
dropping_tables++;
if (likely(signalled))
{
dropping_tables++;
(void) pthread_cond_wait(&COND_refresh, &LOCK_open);
dropping_tables--;
continue;
}
else
{
struct timespec abstime;
/*
It can happen that another thread has opened the
table but has not yet locked any table at all. Since
@ -4173,11 +4174,11 @@ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name,
and then we retry another loop in the
remove_table_from_cache routine.
*/
pthread_mutex_unlock(&LOCK_open);
my_sleep(10);
pthread_mutex_lock(&LOCK_open);
continue;
set_timespec(abstime, 10);
pthread_cond_timedwait(&COND_refresh, &LOCK_open, &abstime);
}
dropping_tables--;
continue;
}
}
break;