aboutsummaryrefslogtreecommitdiffstats
path: root/3rdparty/pybind11/tests/test_gil_scoped.py
diff options
context:
space:
mode:
authorMiodrag Milanović <mmicko@gmail.com>2021-01-02 11:16:49 +0100
committerGitHub <noreply@github.com>2021-01-02 11:16:49 +0100
commit9b9628047c01a970cfe20f83f2b7129ed109440d (patch)
tree1db418e9a889dc6fbe6199c5259aac9bd8cbb32f /3rdparty/pybind11/tests/test_gil_scoped.py
parentc6cdf30501dcb2da01361229dd66a05dad73a132 (diff)
parent61b07bc9a664d6a88b85aae99f9756d7569688a9 (diff)
downloadnextpnr-9b9628047c01a970cfe20f83f2b7129ed109440d.tar.gz
nextpnr-9b9628047c01a970cfe20f83f2b7129ed109440d.tar.bz2
nextpnr-9b9628047c01a970cfe20f83f2b7129ed109440d.zip
Merge pull request #549 from YosysHQ/update
Update pybind11 version and fix for future python versions
Diffstat (limited to '3rdparty/pybind11/tests/test_gil_scoped.py')
-rw-r--r--3rdparty/pybind11/tests/test_gil_scoped.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/3rdparty/pybind11/tests/test_gil_scoped.py b/3rdparty/pybind11/tests/test_gil_scoped.py
index 1548337c..0a1d6274 100644
--- a/3rdparty/pybind11/tests/test_gil_scoped.py
+++ b/3rdparty/pybind11/tests/test_gil_scoped.py
@@ -1,5 +1,7 @@
+# -*- coding: utf-8 -*-
import multiprocessing
import threading
+
from pybind11_tests import gil_scoped as m
@@ -19,6 +21,7 @@ def _run_in_process(target, *args, **kwargs):
def _python_to_cpp_to_python():
"""Calls different C++ functions that come back to Python."""
+
class ExtendedVirtClass(m.VirtClass):
def virtual_func(self):
pass
@@ -48,6 +51,7 @@ def _python_to_cpp_to_python_from_threads(num_threads, parallel=False):
thread.join()
+# TODO: FIXME, sometimes returns -11 (segfault) instead of 0 on macOS Python 3.9
def test_python_to_cpp_to_python_from_thread():
"""Makes sure there is no GIL deadlock when running in a thread.
@@ -56,6 +60,7 @@ def test_python_to_cpp_to_python_from_thread():
assert _run_in_process(_python_to_cpp_to_python_from_threads, 1) == 0
+# TODO: FIXME on macOS Python 3.9
def test_python_to_cpp_to_python_from_thread_multiple_parallel():
"""Makes sure there is no GIL deadlock when running in a thread multiple times in parallel.
@@ -64,14 +69,18 @@ def test_python_to_cpp_to_python_from_thread_multiple_parallel():
assert _run_in_process(_python_to_cpp_to_python_from_threads, 8, parallel=True) == 0
+# TODO: FIXME on macOS Python 3.9
def test_python_to_cpp_to_python_from_thread_multiple_sequential():
"""Makes sure there is no GIL deadlock when running in a thread multiple times sequentially.
It runs in a separate process to be able to stop and assert if it deadlocks.
"""
- assert _run_in_process(_python_to_cpp_to_python_from_threads, 8, parallel=False) == 0
+ assert (
+ _run_in_process(_python_to_cpp_to_python_from_threads, 8, parallel=False) == 0
+ )
+# TODO: FIXME on macOS Python 3.9
def test_python_to_cpp_to_python_from_process():
"""Makes sure there is no GIL deadlock when using processes.