MySQL 8.3.0
Source Code Documentation
my_timer.h File Reference
#include "my_config.h"
#include <time.h>

Go to the source code of this file.

Classes

struct  my_timer_t
 

Typedefs

typedef timer_t os_timer_t
 

Functions

int my_timer_initialize ()
 Initialize internal components. More...
 
void my_timer_deinitialize ()
 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...
 

Typedef Documentation

◆ os_timer_t

typedef timer_t os_timer_t

Function Documentation

◆ my_timer_cancel()

int my_timer_cancel ( my_timer_t timer,
int *  state 
)

Cancel the timer.

Parameters
timerTimer object.
stateThe state of the timer at the time of cancellation, either signaled (false) or nonsignaled (true).
Returns
On success, 0. On error, -1 is returned, and errno is set to indicate the error.

◆ my_timer_create()

int my_timer_create ( my_timer_t timer)

Create a timer object.

Parameters
timerLocation where the timer ID is returned.
Returns
On success, 0. On error, -1 is returned, and errno is set to indicate the error.

◆ my_timer_deinitialize()

void my_timer_deinitialize ( )

Release any resources that were allocated as part of initialization.

◆ my_timer_delete()

void my_timer_delete ( my_timer_t timer)

Delete a timer object.

Parameters
timerTimer object.

◆ my_timer_initialize()

int my_timer_initialize ( void  )

Initialize internal components.

Returns
On success, 0. On error, -1 is returned, and errno is set to indicate the error.

◆ my_timer_set()

int my_timer_set ( my_timer_t timer,
unsigned long  time 
)

Set the time until the next expiration of the timer.

Parameters
timerTimer object.
timeAmount of time (in milliseconds) before the timer expires.
Returns
On success, 0. On error, -1 is returned, and errno is set to indicate the error.