1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-05 13:16:09 +03:00

MDEV-16264 - prerequisite patch, periodic thr_timer

Threadpool will need a functionality for periodic thr_timer
(the threadpool maintainence task is a timer that runs periodically).

Also increase the stack size for the timer thread, 8k won't be enough.
This commit is contained in:
Vladislav Vaintroub
2019-10-29 18:20:21 +01:00
parent 786b004972
commit ad17c98dd5
2 changed files with 32 additions and 1 deletions

View File

@@ -23,6 +23,7 @@ extern "C" {
typedef struct st_timer {
struct timespec expire_time;
ulonglong period;
my_bool expired;
uint index_in_queue;
void (*func)(void*);
@@ -36,6 +37,7 @@ void end_thr_timer();
/* Functions for handling one timer */
void thr_timer_init(thr_timer_t *timer_data, void(*function)(void*),
void *arg);
void thr_timer_set_period(thr_timer_t* timer_data, ulonglong microseconds);
my_bool thr_timer_settime(thr_timer_t *timer_data, ulonglong microseconds);
void thr_timer_end(thr_timer_t *timer_data);