Skip to content

Commit f649935

Browse files
committed
optimize: we no longer clear the lua_State pointers for dead "light threads" such that their coroutine context structs could be reused by other "light threads" and user coroutines.
1 parent 8f4c485 commit f649935

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

src/ngx_http_lua_util.c

-4
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,6 @@ ngx_http_lua_del_thread(ngx_http_request_t *r, lua_State *L,
363363
luaL_unref(L, -1, coctx->co_ref);
364364
coctx->co_ref = LUA_NOREF;
365365
coctx->co_status = NGX_HTTP_LUA_CO_DEAD;
366-
coctx->co = NULL;
367366

368367
lua_pop(L, 1);
369368
}
@@ -396,7 +395,6 @@ ngx_http_lua_del_all_threads(ngx_http_request_t *r, lua_State *L,
396395
ctx->uthreads--;
397396
}
398397

399-
cc->co = NULL;
400398
cc->co_status = NGX_HTTP_LUA_CO_DEAD;
401399
}
402400

@@ -435,7 +433,6 @@ ngx_http_lua_del_all_threads(ngx_http_request_t *r, lua_State *L,
435433
luaL_unref(L, -1, ref);
436434
cc[i].co_ref = LUA_NOREF;
437435
cc[i].co_status = NGX_HTTP_LUA_CO_DEAD;
438-
cc[i].co = NULL;
439436
ctx->uthreads--;
440437

441438
if (ctx->uthreads == 0) {
@@ -461,7 +458,6 @@ ngx_http_lua_del_all_threads(ngx_http_request_t *r, lua_State *L,
461458
luaL_unref(L, -1, entry_coctx->co_ref);
462459
entry_coctx->co_ref = LUA_NOREF;
463460
entry_coctx->co_status = NGX_HTTP_LUA_CO_DEAD;
464-
entry_coctx->co = NULL;
465461
}
466462

467463
if (inited) {

0 commit comments

Comments
 (0)