Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.

Commit 8d2006b

Browse files
author
Szymon Romik
authored
Merge pull request #983 from lukaszstolarczuk/merge-stable-1.9-into-stable-1.10
Merge stable-1.9 into stable-1.10
2 parents c593b23 + 7a74f98 commit 8d2006b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

.github/workflows/gha.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ jobs:
6969
CONFIG: [Debug, Release]
7070
steps:
7171
- name: Update PATH
72-
run: |
73-
echo "::add-path::$Env:MSBUILD"
72+
run: echo "${env:MSBUILD}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
7473

7574
- name: Cache vcpkg packages
7675
uses: actions/cache@v1

tests/common/thread_helpers.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,14 @@ parallel_xexec(size_t concurrency, Function f)
3535
{
3636
std::condition_variable cv;
3737
std::mutex m;
38-
size_t counter = 0;
38+
std::unique_ptr<size_t> counter =
39+
std::unique_ptr<size_t>(new size_t(0));
3940

4041
auto syncthreads = [&] {
4142
std::unique_lock<std::mutex> lock(m);
42-
counter++;
43-
if (counter < concurrency)
44-
cv.wait(lock);
43+
(*counter)++;
44+
if (*counter < concurrency)
45+
cv.wait(lock, [&] { return *counter >= concurrency; });
4546
else
4647
/*
4748
* notify_call could be called outside of a lock

0 commit comments

Comments
 (0)