Skip to content

Commit 49cb281

Browse files
v-einhoffstadt
authored andcommitted
fix: Releasing GIL before attempts to lock the mutex #2053
1 parent 736a0b7 commit 49cb281

11 files changed

+226
-138
lines changed

CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,17 @@ if(MV_TESTS_ONLY)
4848
add_definitions(-DMV_TESTS_ONLY)
4949
endif()
5050

51+
# Specifying MV_NO_USER_THREADS turns off some thread safety features (might give
52+
# you some perf gain, yeah, those 0.01%) and must only be used when no user threads
53+
# (threading.Thread) **ever** call DPG API. With MV_NO_USER_THREADS, it's only
54+
# allowed to call DPG from the main thread and from handlers/callbacks.
55+
# Also can be used to get back the behavior of old DPG versions that were thread
56+
# unsafe (for testing/debugging).
57+
set(MV_NO_USER_THREADS ${MV_NO_USER_THREADS})
58+
if(MV_NO_USER_THREADS)
59+
add_definitions(-DMV_NO_USER_THREADS)
60+
endif()
61+
5162
add_subdirectory("thirdparty")
5263

5364
# if this is not a distribution build

0 commit comments

Comments
 (0)