lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,
 
I’ve noticed that there seems to be no way to disable all hooks. Once a hook is
installed, calling lua_sethook( L, 0, 0, 0 ) will not prevent all calls to the hook
function if in between a new thread was created. If this new thread executes
again then the hook will be called. This is because a new thread inherits the
hook settings of the creating thread. Lacking an interface to enumerate all
threads, it seems impossible to disable a hook completely. Is this correct?
 
It seems that using only one hook setting for all threads is more desirable.
Does anybody use the feature to install different hooks on two threads?
 
I have an ideas for a workaround by using another indirection. But are there
any other possible solutions?
 
This is with Lua 5.2.4.
 
- Jörg