W8104 Local Static with constructor dangerous for multi-threaded apps (C++)

From RAD Studio
Jump to: navigation, search

Go Up to Compiler Errors And Warnings (C++) Index

(Command-line option to suppress warning: -w-mls)

This warning is generated for local static objects with constructors for multithreaded programs. This situation can cause problems if two threads enter the containing function at the same time and no critical sections are present, allowing the constructor to potentially be called more than once.