mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-18 10:59:45 +00:00
Address #1551 - better timers handling
This commit is contained in:
1 parent
443d0f0c6c
commit
cf7d1d8041
6 files changed
+48
-38
No files matched your search
+3
-2
@@ -1951,11 +1951,12 @@ struct mg_timer {
|
||||
uint64_t period_ms; // Timer period in milliseconds
|
||||
uint64_t expire; // Expiration timestamp in milliseconds
|
||||
unsigned flags; // Possible flags values below
|
||||
#define MG_TIMER_REPEAT 1 // Call function periodically, otherwise run once
|
||||
#define MG_TIMER_ONCE 0 // Call function once
|
||||
#define MG_TIMER_REPEAT 1 // Call function periodically
|
||||
#define MG_TIMER_RUN_NOW 2 // Call immediately when timer is set
|
||||
void (*fn)(void *); // Function to call
|
||||
void *arg; // Function argument
|
||||
struct mg_timer *next; // Linkage in g_timers list
|
||||
struct mg_timer *next; // Linkage
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
Reference in new issue
Block a user