The information if a function can be called in the controller, the processor or in both threads, can be found on the Reference pages below the description of each function.
It looks like this:
Available in: Controller, Processor.
Script Error - Wrong Thread
If you call a function in the wrong thread, the script module will output an error message.
The output message for the script error of the above example looks like this:
Functions of the controller thread cannot be called in the processor thread and vice versa.
Try to place the function call elsewhere in your script, if this ever happens to you.