mirror of
https://github.com/RYDE-WORK/pybind11.git
synced 2026-02-01 20:43:17 +08:00
Fix embedded threads test on MSVC2015 / Python 2.7
This commit is contained in:
parent
9d698f7fcc
commit
cd2d3ad5df
@ -205,7 +205,7 @@ TEST_CASE("Threads") {
|
|||||||
for (auto i = 0; i < num_threads; ++i) {
|
for (auto i = 0; i < num_threads; ++i) {
|
||||||
threads.emplace_back([&]() {
|
threads.emplace_back([&]() {
|
||||||
py::gil_scoped_acquire gil{};
|
py::gil_scoped_acquire gil{};
|
||||||
py::exec("count += 1", py::globals(), locals);
|
locals["count"] = locals["count"].cast<int>() + 1;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user