GNU libmicrohttpd  0.9.29
mhd_mono_clock.c File Reference
#include "mhd_mono_clock.h"
Include dependency graph for mhd_mono_clock.c:

Go to the source code of this file.

Enumerations

enum  _MHD_mono_clock_source {
  _MHD_CLOCK_NO_SOURCE = 0, _MHD_CLOCK_GETTIME, _MHD_CLOCK_GET_TIME, _MHD_CLOCK_GETHRTIME,
  _MHD_CLOCK_GETTICKCOUNT64, _MHD_CLOCK_PERFCOUNTER
}
 

Functions

void MHD_monotonic_sec_counter_init (void)
 
void MHD_monotonic_sec_counter_finish (void)
 
time_t MHD_monotonic_sec_counter (void)
 

Variables

static time_t sys_clock_start
 

Enumeration Type Documentation

◆ _MHD_mono_clock_source

Type of monotonic clock source

Enumerator
_MHD_CLOCK_NO_SOURCE 

No monotonic clock

_MHD_CLOCK_GETTIME 

clock_gettime() with specific clock

_MHD_CLOCK_GET_TIME 

clock_get_time() with specific clock service

_MHD_CLOCK_GETHRTIME 

gethrtime() / 1000000000

_MHD_CLOCK_GETTICKCOUNT64 

GetTickCount64() / 1000

_MHD_CLOCK_PERFCOUNTER 

QueryPerformanceCounter() / QueryPerformanceFrequency()

Definition at line 100 of file mhd_mono_clock.c.

Function Documentation

◆ MHD_monotonic_sec_counter()

time_t MHD_monotonic_sec_counter ( void  )

Monotonic seconds counter, useful for timeout calculation. Tries to be not affected by manually setting the system real time clock or adjustments by NTP synchronization.

Returns
number of seconds from some fixed moment

Definition at line 337 of file mhd_mono_clock.c.

References NULL, and sys_clock_start.

Referenced by internal_add_connection(), MHD_connection_handle_idle(), MHD_digest_auth_check(), MHD_get_timeout(), MHD_queue_auth_fail_response(), MHD_set_connection_option(), MHD_tls_connection_handle_idle(), MHD_update_last_activity_(), resume_suspended_connections(), and thread_main_handle_connection().

Here is the caller graph for this function:

◆ MHD_monotonic_sec_counter_finish()

void MHD_monotonic_sec_counter_finish ( void  )

Deinitialise monotonic seconds counter by freeing any allocated resources

Definition at line 316 of file mhd_mono_clock.c.

Referenced by MHD_fini().

Here is the caller graph for this function:

◆ MHD_monotonic_sec_counter_init()

void MHD_monotonic_sec_counter_init ( void  )

Initialise monotonic seconds counter.

Definition at line 138 of file mhd_mono_clock.c.

References _MHD_CLOCK_GET_TIME, _MHD_CLOCK_GETHRTIME, _MHD_CLOCK_GETTICKCOUNT64, _MHD_CLOCK_GETTIME, _MHD_CLOCK_NO_SOURCE, _MHD_CLOCK_PERFCOUNTER, NULL, and sys_clock_start.

Referenced by MHD_init().

Here is the caller graph for this function:

Variable Documentation

◆ sys_clock_start

time_t sys_clock_start
static

Definition at line 82 of file mhd_mono_clock.c.

Referenced by MHD_monotonic_sec_counter(), and MHD_monotonic_sec_counter_init().