Merge pull request #5644 from tweag/fix-interrupted-data-race

Fix a minor data race with _isInterrupted
This commit is contained in:
Eelco Dolstra 2021-11-25 13:55:03 +01:00 committed by GitHub
commit 1f7584d24c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -1205,7 +1205,7 @@ void closeOnExec(int fd)
//////////////////////////////////////////////////////////////////////
bool _isInterrupted = false;
std::atomic<bool> _isInterrupted = false;
static thread_local bool interruptThrown = false;
thread_local std::function<bool()> interruptCheck;

View file

@ -337,7 +337,7 @@ void closeOnExec(int fd);
/* User interruption. */
extern bool _isInterrupted;
extern std::atomic<bool> _isInterrupted;
extern thread_local std::function<bool()> interruptCheck;