Pārlūkot izejas kodu

Merge pull request #246 from MatthewWertman/kthread-complete-and-exit5.17

add complete_and_exit() for kernels older than 5.17
Ole Petter Bang 2 gadi atpakaļ
vecāks
revīzija
1943d4fadd
1 mainītis faili ar 6 papildinājumiem un 2 dzēšanām
  1. 6 2
      include/osdep_service_linux.h

+ 6 - 2
include/osdep_service_linux.h

@@ -145,8 +145,12 @@
 	typedef void*		_thread_hdl_;
 	typedef int		thread_return;
 	typedef void*	thread_context;
-
-	#define thread_exit() kthread_complete_and_exit(NULL, 0)
+    
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
+    #define thread_exit() complete_and_exit(NULL, 0)
+#else
+    #define thread_exit() kthread_complete_and_exit(NULL, 0)
+#endif
 
 	typedef void timer_hdl_return;
 	typedef void* timer_hdl_context;