diff options
author | unknown <sasha@mysql.sashanet.com> | 2001-01-26 20:00:42 -0700 |
---|---|---|
committer | unknown <sasha@mysql.sashanet.com> | 2001-01-26 20:00:42 -0700 |
commit | eb5706d128539f1aa98690793e9344df280f98c8 (patch) | |
tree | 34fc82c32df58fa2ccbcfe388b654b363c872ab2 /mysys | |
parent | 70e783fa2e22e03f3ffd59038ceb26fcef577f68 (diff) | |
download | mariadb-git-eb5706d128539f1aa98690793e9344df280f98c8.tar.gz |
Table_locks_waited
Table_locks_immediate
mysys/thr_lock.c:
count locks
sql/mysqld.cc:
count locks
sql/sql_base.cc:
count locks
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/thr_lock.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c index 5c48ad435a4..6f5f8afac3c 100644 --- a/mysys/thr_lock.c +++ b/mysys/thr_lock.c @@ -83,7 +83,7 @@ multiple read locks. #include <errno.h> my_bool thr_lock_inited=0; - +ulong locks_immediate = 0L, locks_waited = 0L; /* The following constants are only for debug output */ #define MAX_THREADS 100 @@ -387,6 +387,7 @@ static my_bool wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data, else { result=0; + ++locks_waited; if (data->lock->get_status) (*data->lock->get_status)(data->status_param); check_locks(data->lock,"got wait_for_lock",0); @@ -447,6 +448,7 @@ int thr_lock(THR_LOCK_DATA *data,enum thr_lock_type lock_type) check_locks(lock,"read lock with old write lock",0); if (lock->get_status) (*lock->get_status)(data->status_param); + ++locks_immediate; goto end; } if (lock->write.data->type == TL_WRITE_ONLY) @@ -470,6 +472,7 @@ int thr_lock(THR_LOCK_DATA *data,enum thr_lock_type lock_type) if ((int) lock_type == (int) TL_READ_NO_INSERT) lock->read_no_write_count++; check_locks(lock,"read lock with no write locks",0); + ++locks_immediate; goto end; } /* Can't get lock yet; Wait for it */ @@ -501,6 +504,7 @@ int thr_lock(THR_LOCK_DATA *data,enum thr_lock_type lock_type) data->cond=get_cond(); if (lock->get_status) (*lock->get_status)(data->status_param); + ++locks_immediate; goto end; } } @@ -535,6 +539,7 @@ int thr_lock(THR_LOCK_DATA *data,enum thr_lock_type lock_type) check_locks(lock,"second write lock",0); if (data->lock->get_status) (*data->lock->get_status)(data->status_param); + ++locks_immediate; goto end; } DBUG_PRINT("lock",("write locked by thread: %ld", @@ -560,6 +565,7 @@ int thr_lock(THR_LOCK_DATA *data,enum thr_lock_type lock_type) if (data->lock->get_status) (*data->lock->get_status)(data->status_param); check_locks(lock,"only write lock",0); + ++locks_immediate; goto end; } } |