diff options
author | unknown <monty@mysql.com> | 2005-07-26 17:55:58 +0300 |
---|---|---|
committer | unknown <monty@mysql.com> | 2005-07-26 17:55:58 +0300 |
commit | 90e41facf78150df4f8d387f6d44647957c7a8a0 (patch) | |
tree | 91bfa7092c665b2c4842cc67bff19a328d434aa4 /sql/lock.cc | |
parent | 1f36f6f45b7984bbbd2afe94c946cc00c7fcc529 (diff) | |
download | mariadb-git-90e41facf78150df4f8d387f6d44647957c7a8a0.tar.gz |
Review fixes:
Fixed portability problem with bool in C programs
Moved close_thread_tables out from LOCK_thread_count mutex (safety fix)
my_sleep() -> pthread_cond_timedwait()
include/thr_lock.h:
bool -> my_bool (bool is not portable in C programs)
mysys/thr_lock.c:
bool -> my_bool (bool is not portable in C programs)
sql/lock.cc:
Added comment
Don't use | on bool variable
sql/mysql_priv.h:
Added comment
sql/slave.cc:
Moved close_thread_tables out from LOCK_thread_count mutex (safety fix)
sql/sql_base.cc:
Added comments
my_sleep() -> pthread_cond_timedwait() to get less code and potentitally faster loop
BitKeeper/etc/ignore:
added ac_available_languages_fragment
Diffstat (limited to 'sql/lock.cc')
-rw-r--r-- | sql/lock.cc | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/sql/lock.cc b/sql/lock.cc index eb49254215d..47ccc44952d 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -331,7 +331,18 @@ void mysql_lock_abort(THD *thd, TABLE *table) } -/* Abort one thread / table combination */ +/* + Abort one thread / table combination + + SYNOPSIS + mysql_lock_abort_for_thread() + thd Thread handler + table Table that should be removed from lock queue + + RETURN + 0 Table was not locked by another thread + 1 Table was locked by at least one other thread +*/ bool mysql_lock_abort_for_thread(THD *thd, TABLE *table) { @@ -344,10 +355,9 @@ bool mysql_lock_abort_for_thread(THD *thd, TABLE *table) { for (uint i=0; i < locked->lock_count; i++) { - bool found; - found= thr_abort_locks_for_thread(locked->locks[i]->lock, - table->in_use->real_id); - result|= found; + if (thr_abort_locks_for_thread(locked->locks[i]->lock, + table->in_use->real_id)) + result= TRUE; } my_free((gptr) locked,MYF(0)); } |