-
- Downloads
[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...
Showing
- dune/common/CMakeLists.txt 2 additions, 0 deletionsdune/common/CMakeLists.txt
- dune/common/Makefile.am 3 additions, 1 deletiondune/common/Makefile.am
- dune/common/stdthread.cc 75 additions, 0 deletionsdune/common/stdthread.cc
- dune/common/stdthread.hh 54 additions, 0 deletionsdune/common/stdthread.hh
Loading
Please register or sign in to comment