GL backend: fix race condition when asserting a handle exists

This commit is contained in:
Mathias Agopian
2021-02-22 23:24:31 -08:00
committed by Mathias Agopian
parent 3a15756c78
commit bc6acd5c5a
3 changed files with 37 additions and 14 deletions

View File

@@ -20,9 +20,18 @@
namespace utils {
void panic(const char *func, const char * file, int line, const char *assertion) noexcept {
PANIC_LOG("%s:%d: failed assertion `%s'\n", file, line, assertion);
// we use a non-inlined, not marked as "no return" function for aborting so that we can set
// a breakpoint on the call to abort() in panic() below and skip over it in the debugger if
// needed.
UTILS_NOINLINE
void abort() noexcept {
std::abort();
}
void panic(const char *func, const char * file, int line, const char *assertion) noexcept {
PANIC_LOG("%s:%d: failed assertion `%s'\n", file, line, assertion);
abort(); // set a breakpoint here
return; // this line is needed to be able to move the cursor here in the debugger
}
} // namespace filament