Skip to content
Snippets Groups Projects
Commit 92947aaf authored by Jö Fahlke's avatar Jö Fahlke
Browse files

[threads] Introduce DUNE_ASSERT_CALL_ONCE and assertCallOnce().

These check whether std::call_once() works and provide a helpful error message
if it does not.  They should be used in any code that uses std::call_once().

Call once may not work if one forgets to _link_ with -pthread (or similar
options).  The nasty think about this is that linking still succeeds, so this
can only be detected at run time.  We cannot (in general) run compiled
programs during configure, since we may be cross-compiling, so whatever we get
from configure is at best a guess.

Even if configure detects the necessary flags correctly, there may still be
errors in the build system such that the executable is linked without them.

The reason to provide such a facility is that the bug is quite difficult to
debug when it appears.  The error message is mangled due to a different bug,
and is quite unhelpful anyway.  And then there is the fun with weak symbols...
parent 5b0bdc28
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment