Regular API function

simSetThreadAutomaticSwitch

Description Allows to temporarily forbid thread switches. If the current script doesn't run in a thread (i.e. if it runs in the application main thread), this function has no effect. By default, V-REP doesn't use "regular" threads, but something similar to hybrid threads (which behave like coroutines, but can also behave like regular threads). This allows much more flexibility and execution control of the threads. For complete control over the switching moment, see also simGetThreadAutomaticSwitch, simSetThreadSwitchTiming, simSwitchThread, simSetThreadIsFree and simSetThreadResumeLocation.
C synopsis -
C parameters
-
C return value
-
Lua synopsis number result=simSetThreadAutomaticSwitch(Boolean switchIsAutomatic)
Lua parameters
switchIsAutomatic: if true, the thread will be able to automatically switch to another thread, otherwise the switching is temporarily disabled.
Lua return values
result: 1 if the command was successful, 0 if it didn't have an effect (e.g. because the function was called from the main or application thread), or -1 in case of an error.

All regular API functions on one page