Compile time define for checking threadsafe flag of functions
Thu, 08/29/2019 - 11:01 am
I have some code which does
Multithread data = FuncTS()
threadsafe static Function FuncTS()
// do stuff
As FuncTS is a bit difficult to understand I would like to add some debugging output for easy testing (testing would be done without Multithread/threadsafe keywords). Unfortunately that debugging output requires non-threadsafe functions.
Is there a way to have two code paths in the function? One for threadsafe and one for non-threadsafe?
// debug output
Another solution would be if threadsafe and non-threadsafe functions could be overloaded but I'm not sure that this would be a good thing.