diff options
author | monty@mashka.mysql.fi <> | 2003-08-11 22:44:43 +0300 |
---|---|---|
committer | monty@mashka.mysql.fi <> | 2003-08-11 22:44:43 +0300 |
commit | 2263e3e51faba531a0a7055dbf706a6a8719ad70 (patch) | |
tree | 3c0ddcb446b8be099c3ab2616c459a573ee3cf92 /mysys/thr_lock.c | |
parent | 1279f9b024614cf97cf447cfb10d6d7d69abb8bc (diff) | |
parent | 6e7a509d06824447e427dd44d5692489267d9c4b (diff) | |
download | mariadb-git-2263e3e51faba531a0a7055dbf706a6a8719ad70.tar.gz |
Merge with 4.0.14
Diffstat (limited to 'mysys/thr_lock.c')
-rw-r--r-- | mysys/thr_lock.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c index b6e7cb47234..0e3ccfc0452 100644 --- a/mysys/thr_lock.c +++ b/mysys/thr_lock.c @@ -172,10 +172,13 @@ static int check_lock(struct st_lock_list *list, const char* lock_type, return 0; } + static void check_locks(THR_LOCK *lock, const char *where, my_bool allow_no_locks) { uint old_found_errors=found_errors; + DBUG_ENTER("check_locks"); + if (found_errors < MAX_FOUND_ERRORS) { if (check_lock(&lock->write,"write",where,1,1) | @@ -252,18 +255,21 @@ static void check_locks(THR_LOCK *lock, const char *where, } if (lock->read.data) { - if ((!pthread_equal(lock->write.data->thread, - lock->read.data->thread) && - lock->write.data->type > TL_WRITE_DELAYED && - lock->write.data->type != TL_WRITE_ONLY) || - ((lock->write.data->type == TL_WRITE_CONCURRENT_INSERT || - lock->write.data->type == TL_WRITE_ALLOW_WRITE) && - lock->read_no_write_count)) + if (!pthread_equal(lock->write.data->thread, + lock->read.data->thread) && + ((lock->write.data->type > TL_WRITE_DELAYED && + lock->write.data->type != TL_WRITE_ONLY) || + ((lock->write.data->type == TL_WRITE_CONCURRENT_INSERT || + lock->write.data->type == TL_WRITE_ALLOW_WRITE) && + lock->read_no_write_count))) { found_errors++; fprintf(stderr, "Warning at '%s': Found lock of type %d that is write and read locked\n", where, lock->write.data->type); + DBUG_PRINT("warning",("At '%s': Found lock of type %d that is write and read locked\n", + where, lock->write.data->type)); + } } if (lock->read_wait.data) @@ -286,6 +292,7 @@ static void check_locks(THR_LOCK *lock, const char *where, DBUG_PRINT("error",("Found wrong lock")); } } + DBUG_VOID_RETURN; } #else /* EXTRA_DEBUG */ |