Don't need to wrap thread object in a table.

pull/47/merge
Robert G. Jakabosky 13 years ago
parent 3499ee79ae
commit 8f7dda3147

@ -25,21 +25,6 @@
local zmq = require"zmq" local zmq = require"zmq"
local llthreads = require"llthreads" local llthreads = require"llthreads"
local setmetatable = setmetatable
local tonumber = tonumber
local assert = assert
local thread_mt = {}
thread_mt.__index = thread_mt
function thread_mt:start(detached)
return self.thread:start(detached)
end
function thread_mt:join()
return self.thread:join()
end
local bootstrap_pre = [[ local bootstrap_pre = [[
local action, action_arg, parent_ctx = ... local action, action_arg, parent_ctx = ...
local func local func
@ -79,10 +64,7 @@ local function new_thread(ctx, action, action_arg, ...)
if ctx then if ctx then
ctx = ctx:lightuserdata() ctx = ctx:lightuserdata()
end end
local thread = llthreads.new(bootstrap_code, action, action_arg, ctx, ...) return llthreads.new(bootstrap_code, action, action_arg, ctx, ...)
return setmetatable({
thread = thread,
}, thread_mt)
end end
local M = {} local M = {}

Loading…
Cancel
Save