Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luv_work_ctx_t async #467

Closed
SinisterRectus opened this issue Mar 28, 2020 · 1 comment
Closed

luv_work_ctx_t async #467

SinisterRectus opened this issue Mar 28, 2020 · 1 comment
Assignees

Comments

@SinisterRectus
Copy link
Member

luv_work_ctx_t defines an async handle and async_cb reference...

luv/src/work.c

Lines 20 to 29 in ecfed21

typedef struct {
lua_State* L; /* vm in main */
char* code; /* thread entry code */
size_t len;
uv_async_t async;
int async_cb; /* ref, run in main, call when async message received */
int after_work_cb; /* ref, run in main ,call after work cb*/
int pool_ref; /* ref of lua_State cache array */
} luv_work_ctx_t;

luv_new_work optionally initializes this handle with a callback...

luv/src/work.c

Lines 177 to 179 in ecfed21

lua_pushvalue(L, 3);
ctx->async_cb = luaL_ref(L, LUA_REGISTRYINDEX);
uv_async_init(luv_loop(L), &ctx->async, async_cb);

but as far as I can tell, the handle is never exposed to Lua. Am I missing something here?

@zhaozg
Copy link
Member

zhaozg commented Mar 29, 2020

Yes, you are right, that code should be remove, and I found a associated bug .

So I'll deal that.

@zhaozg zhaozg self-assigned this Mar 29, 2020
@zhaozg zhaozg closed this as completed in 1ab7ed9 Mar 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants