Regular API function

sim.setThreadAutomaticSwitch

Description Deprecated. See sim.setStepping instead
C/C++
synopsis
C/C++
parameters
C/C++
return value
Lua
synopsis
int previousLockLevel=sim.setThreadAutomaticSwitch(bool allowAutoSwitch / int lockLevel)
Lua
parameters
allowAutoSwitch: if false, then the thread will not be automatically interrupted anymore (i.e. automatic thread switching will be temporarily disabled). Calling n times sim.setThreadAutomaticSwitch(false) requires to call n times sim.setThreadAutomaticSwitch(true) to restore the initial behaviour.
lockLevel: allows to set an auto switch lock level: a level > 0 indicates that automatic thread interruption is disabled.
Best is to always use following to temporarily lock automatic thread interruptions:
--lua local initialLockLevel=sim.setThreadAutomaticSwitch(false) -- lock automatic thread switches ... sim.setThreadAutomaticSwitch(initialLockLevel) -- restore to initial state
Lua
return values
previousLockLevel: the lock level before calling the function, i.e. the lock level that should be restored later on.
Python
synopsis