summaryrefslogtreecommitdiff
path: root/lib/ioctl_wrappers.h
diff options
context:
space:
mode:
authorChris Wilson <chris.p.wilson@linux.intel.com>2023-06-12 19:23:10 +0200
committerZbigniew Kempczyński <zbigniew.kempczynski@intel.com>2023-07-21 12:53:40 +0200
commit602cdd3c87fad86cab8b15fe4242f2a119ce48df (patch)
tree100216654eeb0d882a0fa2efdcc7c5fd97bb9acd /lib/ioctl_wrappers.h
parent8d298f3c92ba1afbb43cc7142d3b40c1f681c989 (diff)
lib: Make igt_while_interruptible() thread-safe
We have the ability to replace the ioctl() call by a wrapper that performs signal injection (triggering the ioctl to return -EINTR). This uses a global for handling the signal, which is broken if the test tries to mixing SIGINT injection and threads. Switch to a thread-local sigaction. Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Signed-off-by: Chris Wilson <chris.p.wilson@linux.intel.com> Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Diffstat (limited to 'lib/ioctl_wrappers.h')
-rw-r--r--lib/ioctl_wrappers.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h
index 4c232078d..b7d7c2ad9 100644
--- a/lib/ioctl_wrappers.h
+++ b/lib/ioctl_wrappers.h
@@ -48,7 +48,7 @@
* This is a wrapper around drmIoctl(), which can be augmented with special code
* blocks like #igt_while_interruptible.
*/
-extern int (*igt_ioctl)(int fd, unsigned long request, void *arg);
+extern __thread int (*igt_ioctl)(int fd, unsigned long request, void *arg);
/* ioctl_wrappers.c:
*