[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Per-thread immutable variable
- From: William Ahern <wahern@...>
- Date: Tue, 09 Aug 2005 13:53:22 -0700
How would I go about creating a per-thread immutable table which is a
different C object for each thread? Do I add it to the globals for each
thread? Or, do I create an upvalue? in the thread? But, is it possible
to make an upvalue immutable?
Actually, to be more precise I want to create a sandbox for code which
runs in it's own thread (possibly creating more threads though not
necessary), and which has access to immutable C objects--so that Lua
code can't remove the object, which is necessary for underlying C code
to know the context of the thread.
Also, is the registry global across all threads created from the same
original Lua context?
William Ahern <email@example.com>