diff options
author | unknown <serg@serg.mylan> | 2005-12-23 20:50:28 +0100 |
---|---|---|
committer | unknown <serg@serg.mylan> | 2005-12-23 20:50:28 +0100 |
commit | bcc1ecd37b5434503a7280719088558a8a26b61f (patch) | |
tree | 2594fb169d9c168d8ecb0490a4bbebd32149426e /mysys | |
parent | 06e996639664f2f5270793047b47830fd85edbd7 (diff) | |
download | mariadb-git-bcc1ecd37b5434503a7280719088558a8a26b61f.tar.gz |
locking issues,
test for LONGLONG_MIN in decimal.c
myisam/mi_create.c:
lock THR_LOCK_myisam later
mysys/thr_alarm.c:
remove misplaced comment and "safety" if()
server-tools/instance-manager/instance.cc:
add unlock
strings/decimal.c:
correct the test for LONGLONG_MIN. fix debug sprintf
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/thr_alarm.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c index e5b77de5e38..41914080a9d 100644 --- a/mysys/thr_alarm.c +++ b/mysys/thr_alarm.c @@ -401,7 +401,7 @@ void end_thr_alarm(my_bool free_structures) { DBUG_ENTER("end_thr_alarm"); if (alarm_aborted != 1) /* If memory not freed */ - { + { pthread_mutex_lock(&LOCK_alarm); DBUG_PRINT("info",("Resheduling %d waiting alarms",alarm_queue.elements)); alarm_aborted= -1; /* mark aborted */ @@ -415,13 +415,10 @@ void end_thr_alarm(my_bool free_structures) if (free_structures) { struct timespec abstime; - /* - The following test is just for safety, the caller should not - depend on this - */ + DBUG_ASSERT(!alarm_queue.elements); - /* Wait until alarm thread dies */ + /* Wait until alarm thread dies */ set_timespec(abstime, 10); /* Wait up to 10 seconds */ while (alarm_thread_running) { @@ -429,16 +426,13 @@ void end_thr_alarm(my_bool free_structures) if (error == ETIME || error == ETIMEDOUT) break; /* Don't wait forever */ } - if (!alarm_queue.elements) + delete_queue(&alarm_queue); + alarm_aborted= 1; + pthread_mutex_unlock(&LOCK_alarm); + if (!alarm_thread_running) /* Safety */ { - delete_queue(&alarm_queue); - alarm_aborted= 1; - pthread_mutex_unlock(&LOCK_alarm); - if (!alarm_thread_running) /* Safety */ - { - pthread_mutex_destroy(&LOCK_alarm); - pthread_cond_destroy(&COND_alarm); - } + pthread_mutex_destroy(&LOCK_alarm); + pthread_cond_destroy(&COND_alarm); } } else |