diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-10-25 17:05:28 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-10-25 17:05:28 -0300 |
| commit | 96e15b8501e5d8fc40c475cbac573f910ab5853b (patch) | |
| tree | 2c8efededa6849704f0db3075d0cbe0efaa40b2d /ltests.c | |
| parent | 0fd91b1b087b478fffa36f96bc0f608d86627a4b (diff) | |
| download | lua-96e15b8501e5d8fc40c475cbac573f910ab5853b.tar.gz lua-96e15b8501e5d8fc40c475cbac573f910ab5853b.tar.bz2 lua-96e15b8501e5d8fc40c475cbac573f910ab5853b.zip | |
threads now are real Lua objects, subject to garbage collection
Diffstat (limited to 'ltests.c')
| -rw-r--r-- | ltests.c | 7 |
1 files changed, 3 insertions, 4 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltests.c,v 1.136 2002/10/22 17:18:28 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 1.137 2002/10/22 18:07:55 roberto Exp roberto $ |
| 3 | ** Internal Module for Debugging of the Lua Implementation | 3 | ** Internal Module for Debugging of the Lua Implementation |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -403,7 +403,6 @@ static int doonnewstack (lua_State *L) { | |||
| 403 | if (status == 0) | 403 | if (status == 0) |
| 404 | status = lua_pcall(L1, 0, 0, 0); | 404 | status = lua_pcall(L1, 0, 0, 0); |
| 405 | lua_pushnumber(L, status); | 405 | lua_pushnumber(L, status); |
| 406 | lua_closethread(L, L1); | ||
| 407 | return 1; | 406 | return 1; |
| 408 | } | 407 | } |
| 409 | 408 | ||
| @@ -423,7 +422,7 @@ static int d2s (lua_State *L) { | |||
| 423 | static int newstate (lua_State *L) { | 422 | static int newstate (lua_State *L) { |
| 424 | lua_State *L1 = lua_open(); | 423 | lua_State *L1 = lua_open(); |
| 425 | if (L1) { | 424 | if (L1) { |
| 426 | *cast(int **, L1) = &islocked; /* initialize the lock */ | 425 | lua_userstateopen(L1); /* init lock */ |
| 427 | lua_pushnumber(L, (unsigned long)L1); | 426 | lua_pushnumber(L, (unsigned long)L1); |
| 428 | } | 427 | } |
| 429 | else | 428 | else |
| @@ -724,7 +723,7 @@ static void fim (void) { | |||
| 724 | 723 | ||
| 725 | 724 | ||
| 726 | int luaB_opentests (lua_State *L) { | 725 | int luaB_opentests (lua_State *L) { |
| 727 | *cast(int **, L) = &islocked; /* init lock */ | 726 | lua_userstateopen(L); /* init lock */ |
| 728 | lua_state = L; /* keep first state to be opened */ | 727 | lua_state = L; /* keep first state to be opened */ |
| 729 | luaL_opennamedlib(L, "T", tests_funcs, 0); | 728 | luaL_opennamedlib(L, "T", tests_funcs, 0); |
| 730 | atexit(fim); | 729 | atexit(fim); |
