summaryrefslogtreecommitdiff
path: root/mysys/thr_alarm.c
diff options
context:
space:
mode:
Diffstat (limited to 'mysys/thr_alarm.c')
-rw-r--r--mysys/thr_alarm.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c
index 2289f8208bc..36bbac16fef 100644
--- a/mysys/thr_alarm.c
+++ b/mysys/thr_alarm.c
@@ -120,6 +120,20 @@ 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 as there may be more pending alarms than
+ than max_alarms
+ */
+ if (alarm_queue.elements < max_alarms)
+ resize_queue(&alarm_queue,max_alarms+1);
+ pthread_mutex_unlock(&LOCK_alarm);
+}
+
+
/*
Request alarm after sec seconds.