This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
stellar-stellar/src/stellar/cron.h
2024-04-17 11:44:38 +08:00

33 lines
608 B
C

#ifndef _CRON_H
#define _CRON_H
#ifdef __cpluscplus
extern "C"
{
#endif
#include <stdint.h>
#include "timeout.h"
struct cron_task
{
struct timeout timeout;
void (*callback)(void *);
void *data;
uint64_t cycle;
};
struct thread_cron;
struct thread_cron *thread_cron_new(uint64_t now);
void thread_cron_free(struct thread_cron *cron);
void thread_cron_run(struct thread_cron *cron, uint64_t now);
void thread_cron_add_task(struct thread_cron *cron, struct cron_task *task);
void thread_cron_del_task(struct thread_cron *cron, struct cron_task *task);
#ifdef __cpluscplus
}
#endif
#endif