CodeTools
ThreadSafetyCheck
analyze a procedure or module for potential thread safety issues
Calling Sequence
Parameters
Description
Examples
Compatibility
ThreadSafetyCheck(p)
p
-
procedure or module
The ThreadSafetyCheck command analyzes the given procedure or module and warns about specific thread-safety issues.
Currently warnings are limited to the use of global variables and the use of lexically scoped local variables that are seen in assignment statements.
The return value consists of a sequence of two integers counting the number of procedures flagged with thread-safety issues, followed by the total number of procedures analyzed.
with⁡CodeTools:
p := proc(a) global x; x*a; end;
p ≔ procaglobalx;x*aend proc
ThreadSafetyCheck⁡p
1,1
m := module() export p1, p2; local a; p1 := proc(n) a := n; end; p2 := proc(n) a^n; end; end module;
m ≔ modulelocala;exportp1,p2;end module
ThreadSafetyCheck⁡m
2,2
The CodeTools[ThreadSafetyCheck] command was introduced in Maple 2016.
For more information on Maple 2016 changes, see Updates in Maple 2016.
See Also
Threads
Download Help Document