MySQL 9.1.0
Source Code Documentation
|
#include <assert.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/event.h>
#include "my_sys.h"
#include "my_thread.h"
#include "my_timer.h"
#include "mysql/psi/mysql_thread.h"
#include "mysys_err.h"
#include "mysys_priv.h"
Functions | |
static void * | timer_notify_thread_func (void *arg) |
Timer expiration notification thread. More... | |
static int | start_helper_thread (void) |
Create a helper thread to dispatch timer expiration notifications. More... | |
int | my_timer_initialize (void) |
Initialize internal components. More... | |
void | my_timer_deinitialize (void) |
Release any resources that were allocated as part of initialization. More... | |
int | my_timer_create (my_timer_t *timer) |
Create a timer object. More... | |
int | my_timer_set (my_timer_t *timer, unsigned long time) |
Set the time until the next expiration of the timer. More... | |
int | my_timer_cancel (my_timer_t *timer, int *state) |
Cancel the timer. More... | |
void | my_timer_delete (my_timer_t *timer) |
Delete a timer object. More... | |
Variables | |
static int | kq_fd = -1 |
static my_thread_handle | timer_notify_thread |
int my_timer_cancel | ( | my_timer_t * | timer, |
int * | state | ||
) |
Cancel the timer.
timer | Timer object. |
state | The state of the timer at the time of cancellation, either signaled (false) or nonsignaled (true). |
int my_timer_create | ( | my_timer_t * | timer | ) |
Create a timer object.
timer | Location where the timer ID is returned. |
void my_timer_deinitialize | ( | void | ) |
Release any resources that were allocated as part of initialization.
void my_timer_delete | ( | my_timer_t * | timer | ) |
Delete a timer object.
timer | Timer object. |
int my_timer_initialize | ( | void | ) |
Initialize internal components.
int my_timer_set | ( | my_timer_t * | timer, |
unsigned long | time | ||
) |
Set the time until the next expiration of the timer.
timer | Timer object. |
time | Amount of time (in milliseconds) before the timer expires. |
|
static |
Create a helper thread to dispatch timer expiration notifications.
|
static |
Timer expiration notification thread.
arg | Unused. |
|
static |
|
static |