1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Merge branch 'master' into testnet

# Conflicts:
#	.github/workflows/ton-x86-64-linux.yml
#	.github/workflows/ton-x86-64-macos.yml
#	.github/workflows/win-2019-compile.yml
#	example/android/build.sh
#	tonlib/tonlib/TonlibClient.cpp
This commit is contained in:
SpyCheese 2023-11-03 15:12:59 +03:00
commit 945d4c3995
4 changed files with 23 additions and 13 deletions

View file

@ -103,23 +103,24 @@ class HttpQueryRunner {
Self->finish(nullptr);
}
});
mutex_.lock();
scheduler_ptr->run_in_context_external([&]() { func(std::move(P)); });
}
void finish(MHD_Response* response) {
std::unique_lock<std::mutex> lock(mutex_);
response_ = response;
mutex_.unlock();
cond.notify_all();
}
MHD_Response* wait() {
mutex_.lock();
mutex_.unlock();
std::unique_lock<std::mutex> lock(mutex_);
cond.wait(lock, [&]() { return response_ != nullptr; });
return response_;
}
private:
std::function<void(td::Promise<MHD_Response*>)> func_;
MHD_Response* response_;
MHD_Response* response_ = nullptr;
std::mutex mutex_;
std::condition_variable cond;
};
class CoreActor : public CoreActorInterface {