summaryrefslogtreecommitdiff
path: root/lib/igt_thread.h
diff options
context:
space:
mode:
authorArkadiusz Hiler <arkadiusz.hiler@intel.com>2020-06-16 15:40:30 +0300
committerArkadiusz Hiler <arkadiusz.hiler@intel.com>2020-06-22 13:31:32 +0300
commitd2e4cb0cf92c7e3f3d8e88841ed9160e97aebbe4 (patch)
tree8fd2a623e0553a92aa658ed302513cf0e2fa0040 /lib/igt_thread.h
parentb787a2f2a0a56e2009f7b8252d93b3a8694f0b53 (diff)
lib/core: Handle asserts in threads
Since IGT is using magic control blocks (igt_subtest et al.) asserts jump out the them using longjmp() causing a bunch of confusing messages and occasionally crashing the whole process. This is not the behavior we want :-) With this patch: 1. simple_main, dynamic and subtest each clears the thread failure state at the start 2. each of those blocks also asserts no thread failures at the end 3. igt_assert() in non-main thread prints out the error + stacktrace and marks that we have failed thread Issue: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/55 Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'lib/igt_thread.h')
-rw-r--r--lib/igt_thread.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/igt_thread.h b/lib/igt_thread.h
index b16f803f..4b9c222d 100644
--- a/lib/igt_thread.h
+++ b/lib/igt_thread.h
@@ -21,4 +21,8 @@
* IN THE SOFTWARE.
*/
+void igt_thread_clear_fail_state(void);
+void igt_thread_fail(void);
+void igt_thread_assert_no_failures(void);
+
bool igt_thread_is_main(void);