Skip to content

Commit d1ad608

Browse files
CopilotYouw
andcommitted
Fix callback_thread CPU overhead by using proper condition variable pattern
Replace broken hidapi_thread_cond_timedwait (which used a fixed absolute timestamp in the past, causing a spin loop) with hidapi_thread_cond_wait using the standard condition variable predicate pattern. - callback_thread: Use cond_wait with proper predicate loop for zero CPU overhead when idle and immediate response on events/shutdown - hid_libusb_hotplug_callback: Protect queue and signal under callback_thread.mutex to prevent lost wakeups - hotplug_thread: Lock mutex before signaling for clean shutdown Agent-Logs-Url: https://github.com/libusb/hidapi/sessions/a47a730b-fbb6-4042-9afb-00e5aa94817d Co-authored-by: Youw <5939659+Youw@users.noreply.github.com>
1 parent 728701c commit d1ad608

55 files changed

Lines changed: 4323 additions & 20 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build/CMakeCache.txt

Lines changed: 561 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
set(CMAKE_C_COMPILER "/usr/bin/cc")
2+
set(CMAKE_C_COMPILER_ARG1 "")
3+
set(CMAKE_C_COMPILER_ID "GNU")
4+
set(CMAKE_C_COMPILER_VERSION "13.3.0")
5+
set(CMAKE_C_COMPILER_VERSION_INTERNAL "")
6+
set(CMAKE_C_COMPILER_WRAPPER "")
7+
set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "17")
8+
set(CMAKE_C_EXTENSIONS_COMPUTED_DEFAULT "ON")
9+
set(CMAKE_C_STANDARD_LATEST "23")
10+
set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert;c_std_17;c_std_23")
11+
set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes")
12+
set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros")
13+
set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert")
14+
set(CMAKE_C17_COMPILE_FEATURES "c_std_17")
15+
set(CMAKE_C23_COMPILE_FEATURES "c_std_23")
16+
17+
set(CMAKE_C_PLATFORM_ID "Linux")
18+
set(CMAKE_C_SIMULATE_ID "")
19+
set(CMAKE_C_COMPILER_FRONTEND_VARIANT "GNU")
20+
set(CMAKE_C_SIMULATE_VERSION "")
21+
22+
23+
24+
25+
set(CMAKE_AR "/usr/bin/ar")
26+
set(CMAKE_C_COMPILER_AR "/usr/bin/gcc-ar-13")
27+
set(CMAKE_RANLIB "/usr/bin/ranlib")
28+
set(CMAKE_C_COMPILER_RANLIB "/usr/bin/gcc-ranlib-13")
29+
set(CMAKE_LINKER "/usr/bin/ld")
30+
set(CMAKE_LINKER_LINK "")
31+
set(CMAKE_LINKER_LLD "")
32+
set(CMAKE_C_COMPILER_LINKER "/usr/bin/ld")
33+
set(CMAKE_C_COMPILER_LINKER_ID "GNU")
34+
set(CMAKE_C_COMPILER_LINKER_VERSION 2.42)
35+
set(CMAKE_C_COMPILER_LINKER_FRONTEND_VARIANT GNU)
36+
set(CMAKE_MT "")
37+
set(CMAKE_TAPI "CMAKE_TAPI-NOTFOUND")
38+
set(CMAKE_COMPILER_IS_GNUCC 1)
39+
set(CMAKE_C_COMPILER_LOADED 1)
40+
set(CMAKE_C_COMPILER_WORKS TRUE)
41+
set(CMAKE_C_ABI_COMPILED TRUE)
42+
43+
set(CMAKE_C_COMPILER_ENV_VAR "CC")
44+
45+
set(CMAKE_C_COMPILER_ID_RUN 1)
46+
set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m)
47+
set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
48+
set(CMAKE_C_LINKER_PREFERENCE 10)
49+
set(CMAKE_C_LINKER_DEPFILE_SUPPORTED )
50+
51+
# Save compiler ABI information.
52+
set(CMAKE_C_SIZEOF_DATA_PTR "8")
53+
set(CMAKE_C_COMPILER_ABI "ELF")
54+
set(CMAKE_C_BYTE_ORDER "LITTLE_ENDIAN")
55+
set(CMAKE_C_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
56+
57+
if(CMAKE_C_SIZEOF_DATA_PTR)
58+
set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
59+
endif()
60+
61+
if(CMAKE_C_COMPILER_ABI)
62+
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
63+
endif()
64+
65+
if(CMAKE_C_LIBRARY_ARCHITECTURE)
66+
set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
67+
endif()
68+
69+
set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "")
70+
if(CMAKE_C_CL_SHOWINCLUDES_PREFIX)
71+
set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}")
72+
endif()
73+
74+
75+
76+
77+
78+
set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/13/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include")
79+
set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "gcc;gcc_s;c;gcc;gcc_s")
80+
set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/13;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib")
81+
set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")
15.6 KB
Binary file not shown.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
set(CMAKE_HOST_SYSTEM "Linux-6.17.0-1008-azure")
2+
set(CMAKE_HOST_SYSTEM_NAME "Linux")
3+
set(CMAKE_HOST_SYSTEM_VERSION "6.17.0-1008-azure")
4+
set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64")
5+
6+
7+
8+
set(CMAKE_SYSTEM "Linux-6.17.0-1008-azure")
9+
set(CMAKE_SYSTEM_NAME "Linux")
10+
set(CMAKE_SYSTEM_VERSION "6.17.0-1008-azure")
11+
set(CMAKE_SYSTEM_PROCESSOR "x86_64")
12+
13+
set(CMAKE_CROSSCOMPILING "FALSE")
14+
15+
set(CMAKE_SYSTEM_LOADED 1)

0 commit comments

Comments
 (0)