From 8191c830cf6d44d700fb74c95746a5c892469823 Mon Sep 17 00:00:00 2001 From: "Robert G. Jakabosky" Date: Fri, 25 Mar 2011 00:18:06 -0700 Subject: [PATCH] Make sure thread:join() returns the 'true' value before the child threads results. --- src/pre_generated-llthreads.nobj.c | 2 +- src/thread.nobj.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pre_generated-llthreads.nobj.c b/src/pre_generated-llthreads.nobj.c index af103e2..a1eaf67 100644 --- a/src/pre_generated-llthreads.nobj.c +++ b/src/pre_generated-llthreads.nobj.c @@ -962,7 +962,7 @@ static int Lua_LLThread__join__meth(lua_State *L) { int top = lua_gettop(child->L); /* return results to parent thread. */ llthread_push_results(L, child, 2, top); - return top - 1; + return top; } else { res_idx1 = false; err_msg_idx2 = strerror(rc); diff --git a/src/thread.nobj.lua b/src/thread.nobj.lua index 0cadf75..4d78b08 100644 --- a/src/thread.nobj.lua +++ b/src/thread.nobj.lua @@ -345,7 +345,7 @@ static Lua_LLThread *llthread_create(lua_State *L, const char *code, size_t code int top = lua_gettop(child->L); /* return results to parent thread. */ llthread_push_results(L, child, 2, top); - return top - 1; + return top; } else { ${res} = false; ${err_msg} = strerror(rc);