#pragma once

#include <Windows.h>
#include "..\Runtime\Runtime.h"
#include "..\common\uthash_runtime.h"

typedef struct _THREAD_PARAMS
{
	PRUNTIME pRuntime;
	void * pArgs;
} THREAD_PARAMS, *PTHREAD_PARAMS;

typedef struct _MONITORED_TIMER_ENTRY {
	void*(__cdecl *callback)(void *);
	VOID* args;
	INT flags;
	time_t time;
	INT iter;
	INT delay;
	
	/* ut hash fields */
	VOID* keyPtr;
	UT_hash_handle hh;
} MONITORED_TIMER_ENTRY, *PMONITORED_TIMER_ENTRY;

void* timer_addwatch(PRUNTIME pRuntime, void* (WINAPI *callback)(void *), void *args, int flags, ...);
void* timer_delwatch(PRUNTIME pRuntime, void *entry);

void monitor_timer_start(PRUNTIME pRuntime);