diff options
author | Benoit Germain <bnt.germain@gmail.com> | 2013-10-04 15:16:00 +0200 |
---|---|---|
committer | Benoit Germain <bnt.germain@gmail.com> | 2013-10-04 15:16:00 +0200 |
commit | 74d75ee51602403f6f4f94bdff919400de24a6cf (patch) | |
tree | 6cbdc6ff3544461d24dcb4b4ed40d488dee26a90 /src/lanes.c | |
parent | 6ef86118e00f24162c243703544854db66ad53fa (diff) | |
download | lanes-74d75ee51602403f6f4f94bdff919400de24a6cf.tar.gz lanes-74d75ee51602403f6f4f94bdff919400de24a6cf.tar.bz2 lanes-74d75ee51602403f6f4f94bdff919400de24a6cf.zip |
Reorder things a tiny weeny bit in lanes.core.configure()
Diffstat (limited to 'src/lanes.c')
-rw-r--r-- | src/lanes.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/lanes.c b/src/lanes.c index f4427a4..7d4f9e7 100644 --- a/src/lanes.c +++ b/src/lanes.c | |||
@@ -2798,7 +2798,7 @@ LUAG_FUNC( configure) | |||
2798 | } | 2798 | } |
2799 | #endif // THREADAPI == THREADAPI_PTHREAD | 2799 | #endif // THREADAPI == THREADAPI_PTHREAD |
2800 | 2800 | ||
2801 | // Create main module interface table | 2801 | // Retrieve main module interface table |
2802 | lua_pushvalue( L, lua_upvalueindex( 2)); // ... M | 2802 | lua_pushvalue( L, lua_upvalueindex( 2)); // ... M |
2803 | // remove configure() (this function) from the module interface | 2803 | // remove configure() (this function) from the module interface |
2804 | lua_pushnil( L); // ... M nil | 2804 | lua_pushnil( L); // ... M nil |
@@ -2807,7 +2807,12 @@ LUAG_FUNC( configure) | |||
2807 | luaG_registerlibfuncs( L, lanes_functions); | 2807 | luaG_registerlibfuncs( L, lanes_functions); |
2808 | STACK_MID( L, 1); | 2808 | STACK_MID( L, 1); |
2809 | 2809 | ||
2810 | // metatable for threads | 2810 | ASSERT_L( timer_deep != NULL); // initialized by init_once_LOCKED |
2811 | luaG_push_proxy( L, linda_id, (DEEP_PRELUDE*) timer_deep); // ... M timer_deep | ||
2812 | lua_setfield( L, -2, "timer_gateway"); // ... M | ||
2813 | STACK_MID( L, 1); | ||
2814 | |||
2815 | // prepare the metatable for threads | ||
2811 | // contains keys: { __gc, __index, cached_error, cached_tostring, cancel, join } | 2816 | // contains keys: { __gc, __index, cached_error, cached_tostring, cancel, join } |
2812 | // | 2817 | // |
2813 | lua_newtable( L); // ... M mt | 2818 | lua_newtable( L); // ... M mt |
@@ -2854,14 +2859,7 @@ LUAG_FUNC( configure) | |||
2854 | // Lua 5.2 no longer has LUA_GLOBALSINDEX: we must push globals table on the stack | 2859 | // Lua 5.2 no longer has LUA_GLOBALSINDEX: we must push globals table on the stack |
2855 | lua_pushglobaltable( L); // ... M _G | 2860 | lua_pushglobaltable( L); // ... M _G |
2856 | populate_func_lookup_table( L, -1, NULL); | 2861 | populate_func_lookup_table( L, -1, NULL); |
2857 | lua_pop( L, 1); // ... M | 2862 | lua_pop( L, 2); // ... |
2858 | |||
2859 | ASSERT_L( timer_deep != NULL); | ||
2860 | // init_once_LOCKED initializes timer_deep, so we must do this after, of course | ||
2861 | luaG_push_proxy( L, linda_id, (DEEP_PRELUDE*) timer_deep); // ... M timer_deep | ||
2862 | lua_setfield( L, -2, "timer_gateway"); // ... M | ||
2863 | |||
2864 | lua_pop( L, 1); // ... | ||
2865 | STACK_END( L, 0); | 2863 | STACK_END( L, 0); |
2866 | DEBUGSPEW_CODE( fprintf( stderr, INDENT_BEGIN "%p: lanes.configure() END\n" INDENT_END, L)); | 2864 | DEBUGSPEW_CODE( fprintf( stderr, INDENT_BEGIN "%p: lanes.configure() END\n" INDENT_END, L)); |
2867 | DEBUGSPEW_CODE( -- debugspew_indent_depth); | 2865 | DEBUGSPEW_CODE( -- debugspew_indent_depth); |