mirror of
https://github.com/Icinga/icinga2.git
synced 2026-06-11 09:40:46 -04:00
`strand.running_in_this_thread()` relies on thread-local storage internally, and may return false positives if the coroutine is resumed in a different thread than it was suspended in. In debug builds, this is not problem, since there's no TLS optimization done by the compiler, but in release builds, the compiler might cache the address of the thread-local variable read before the coroutine suspension, and thus potentially reuse the same address in a different thread after resumption, which would cause `running_in_this_thread()` to return false or even crash (but we didn't see any crashes related to this). So, perform the assertion only in debug builds to prevent potential wrong usages of the `Timeout` class. For more details, see [^1][^2][^3]. [^1]: https://github.com/chriskohlhoff/asio/issues/1366 [^2]: https://bugs.llvm.org/show_bug.cgi?id=19177 [^3]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26461 |
||
|---|---|---|
| .. | ||
| base | ||
| checker | ||
| cli | ||
| compat | ||
| config | ||
| db_ido | ||
| db_ido_mysql | ||
| db_ido_pgsql | ||
| icinga | ||
| icingadb | ||
| livestatus | ||
| methods | ||
| mysql_shim | ||
| notification | ||
| otel | ||
| perfdata | ||
| pgsql_shim | ||
| remote | ||
| CMakeLists.txt | ||