summaryrefslogtreecommitdiff
path: root/mysys/thr_alarm.c
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2003-10-06 14:11:16 +0200
committerunknown <serg@serg.mylan>2003-10-06 14:11:16 +0200
commit08a08a67dbde78258e46b0d9bcd387c8419b8fcd (patch)
tree7bffd47192fc8d22df42f124ba543de3125a5375 /mysys/thr_alarm.c
parent08504cfe276a2ff53ab34a13250220c28702e03c (diff)
downloadmariadb-git-08a08a67dbde78258e46b0d9bcd387c8419b8fcd.tar.gz
fix_max_connections to resize alarm_queue (Bug #1435)
include/queues.h: resize_queue() include/thr_alarm.h: resize_thr_alarm() to resize alarm_queue mysys/queues.c: resize_queue() mysys/thr_alarm.c: resize_thr_alarm() to resize alarm_queue
Diffstat (limited to 'mysys/thr_alarm.c')
-rw-r--r--mysys/thr_alarm.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c
index 2289f8208bc..5d2ac8b0099 100644
--- a/mysys/thr_alarm.c
+++ b/mysys/thr_alarm.c
@@ -120,6 +120,16 @@ void init_thr_alarm(uint max_alarms)
DBUG_VOID_RETURN;
}
+void resize_thr_alarm(uint max_alarms)
+{
+ pthread_mutex_lock(&LOCK_alarm);
+ /* it's ok not to shrink the queue sometimes */
+ if (alarm_queue.elements < max_alarms)
+ resize_queue(&alarm_queue,max_alarms+1);
+ pthread_mutex_unlock(&LOCK_alarm);
+ return;
+}
+
/*
Request alarm after sec seconds.