Skip to content

Commit d2bd9aa

Browse files
committed
In test_thread.{cpp,py}, rename has_barrier
Signed-off-by: Rostan Tabet <[email protected]>
1 parent 056a605 commit d2bd9aa

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

tests/test_thread.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
#include <chrono>
1616
#include <thread>
1717

18-
#if defined(PYBIND11_CPP20) && defined(__has_include) && __has_include(<barrier>)
19-
# define PYBIND11_HAS_STD_BARRIER 1
18+
#if defined(PYBIND11_HAS_STD_BARRIER)
2019
# include <barrier>
2120
#endif
2221

@@ -96,7 +95,7 @@ TEST_SUBMODULE(thread, m) {
9695
});
9796
#endif
9897

99-
m.attr("has_barrier") =
98+
m.attr("defined_PYBIND11_HAS_STD_BARRIER") =
10099
#ifdef PYBIND11_HAS_STD_BARRIER
101100
true;
102101
#else

tests/test_thread.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def access_shared_instance():
7070

7171

7272
@pytest.mark.skipif(sys.platform.startswith("emscripten"), reason="Requires threads")
73-
@pytest.mark.skipif(not m.has_barrier, reason="no <barrier>")
73+
@pytest.mark.skipif(not m.defined_PYBIND11_HAS_STD_BARRIER, reason="no <barrier>")
7474
@pytest.mark.skipif(env.sys_is_gil_enabled(), reason="Deadlock with the GIL")
7575
def test_pythread_state_clear_destructor():
7676
class Foo:

0 commit comments

Comments
 (0)