mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-24 23:31:40 +02:00
This flag indicate that the current yield is returned by the Lua execution task control. If this flag is set, the current task may quit but will be set in the run queue to be re-executed immediatly. This patch modify the "hlua_yieldk()" function, it adds an argument that contain a field containing yield options.
39 lines
1.1 KiB
C
39 lines
1.1 KiB
C
#ifndef _PROTO_HLUA_H
|
|
#define _PROTO_HLUA_H
|
|
|
|
#ifdef USE_LUA
|
|
|
|
#include <lua.h>
|
|
|
|
#include <types/hlua.h>
|
|
|
|
/* The following macros are used to set flags. */
|
|
#define HLUA_SET_RUN(__hlua) do {(__hlua)->flags |= HLUA_RUN;} while(0)
|
|
#define HLUA_CLR_RUN(__hlua) do {(__hlua)->flags &= ~HLUA_RUN;} while(0)
|
|
#define HLUA_IS_RUNNING(__hlua) ((__hlua)->flags & HLUA_RUN)
|
|
#define HLUA_SET_CTRLYIELD(__hlua) do {(__hlua)->flags |= HLUA_CTRLYIELD;} while(0)
|
|
#define HLUA_CLR_CTRLYIELD(__hlua) do {(__hlua)->flags &= ~HLUA_CTRLYIELD;} while(0)
|
|
#define HLUA_IS_CTRLYIELDING(__hlua) ((__hlua)->flags & HLUA_CTRLYIELD)
|
|
|
|
#define HLUA_INIT(__hlua) do { (__hlua)->T = 0; } while(0)
|
|
|
|
/* Lua HAProxy integration functions. */
|
|
void hlua_ctx_destroy(struct hlua *lua);
|
|
void hlua_init();
|
|
int hlua_post_init();
|
|
|
|
#else /* USE_LUA */
|
|
|
|
#define HLUA_IS_RUNNING(__hlua) 0
|
|
|
|
#define HLUA_INIT(__hlua)
|
|
|
|
/* Empty function for compilation without Lua. */
|
|
static inline void hlua_init() { }
|
|
static inline int hlua_post_init() { return 1; }
|
|
static inline void hlua_ctx_destroy() { }
|
|
|
|
#endif /* USE_LUA */
|
|
|
|
#endif /* _PROTO_HLUA_H */
|