Skip to content

Commit eccf3d1

Browse files
fix waitSync (#201)
Signed-off-by: Alexey-N-Chernyshov <[email protected]>
1 parent ceefca4 commit eccf3d1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

core/api/api.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,15 @@ namespace fc::api {
115115
auto waitSync() {
116116
std::condition_variable c;
117117
Result r{outcome::success()};
118+
bool notified = false;
118119
wait([&](auto v) {
119-
r = std::move(v);
120+
r = v;
121+
notified = true;
120122
c.notify_one();
121123
});
122124
std::mutex m;
123125
auto l = std::unique_lock{m};
124-
c.wait(l);
126+
while (!notified) c.wait(l);
125127
return r;
126128
}
127129

0 commit comments

Comments
 (0)