The std::async calls need a lock on them.

This commit is contained in:
Zed A. Shaw 2024-09-15 02:24:41 -04:00
parent 4b2ed2951e
commit ea89e083dd
3 changed files with 9 additions and 3 deletions

View file

@ -42,6 +42,7 @@ class Builder : DeadSimpleFSM<BuildState, BuildEvent> {
string line = "";
std::future<FILE *> build_fut;
std::future<string> read_fut;
std::mutex fsm_mutex;
git_repository* repo = nullptr;
public:
@ -49,6 +50,8 @@ class Builder : DeadSimpleFSM<BuildState, BuildEvent> {
Builder(GUI &g, GameEngine &engine);
MatchResult parse_line(const string &line);
string read_line(FILE *build_out, bool &done_out);
FILE *start_command(string &build_cmd);
void event(BuildEvent ev) override {
try {