]> code.ossystems Code Review - openembedded-core.git/commitdiff
python3: use monotonic clock for condvar if possible
authorZqiang <qiang.zhang@windriver.com>
Tue, 3 Aug 2021 05:11:38 +0000 (13:11 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 5 Aug 2021 07:51:17 +0000 (08:51 +0100)
The timeout for threading.Lock, threading.Condition, etc, is not using
a monotonic clock, it is affected if the system time (realtime clock)
is set.

This patch will make condvar use monotonic clock.
Refence: https://bugs.python.org/issue41710

Signed-off-by: Zqiang <qiang.zhang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/python/python3_3.9.6.bb

index 9fe8e03389d5269e09f2357cfd29316ebff44385..34500642d490489e0d920c2732db660c9b154f23 100644 (file)
@@ -74,6 +74,9 @@ DEPENDS = "bzip2-replacement-native libffi bzip2 openssl sqlite3 zlib virtual/li
 DEPENDS:append:class-target = " python3-native"
 DEPENDS:append:class-nativesdk = " python3-native"
 
+# force to use the mutex+cond implementation (https://bugs.python.org/issue41710)
+CFLAGS += "-DHAVE_BROKEN_POSIX_SEMAPHORES"
+
 EXTRA_OECONF = " --without-ensurepip --enable-shared --with-platlibdir=${baselib}"
 EXTRA_OECONF:append:class-native = " --bindir=${bindir}/${PN}"