mirror of
https://github.com/NixOS/nix
synced 2025-06-25 19:01:16 +02:00
RemoteStore::addToStore(): Fix race between stderrThread and NAR writer
As pointed out by @B4dM4n, the call to to.flush() on stderrThread is unsafe because the NAR writer thread is also writing to 'to'. Fixes #3943.
This commit is contained in:
parent
3ccf3801fb
commit
a0f19d9f3a
3 changed files with 13 additions and 8 deletions
|
@ -23,7 +23,8 @@ struct Sink
|
|||
};
|
||||
|
||||
|
||||
/* A buffered abstract sink. */
|
||||
/* A buffered abstract sink. Warning: a BufferedSink should not be
|
||||
used from multiple threads concurrently. */
|
||||
struct BufferedSink : virtual Sink
|
||||
{
|
||||
size_t bufSize, bufPos;
|
||||
|
@ -66,7 +67,8 @@ struct Source
|
|||
};
|
||||
|
||||
|
||||
/* A buffered abstract source. */
|
||||
/* A buffered abstract source. Warning: a BufferedSink should not be
|
||||
used from multiple threads concurrently. */
|
||||
struct BufferedSource : Source
|
||||
{
|
||||
size_t bufSize, bufPosIn, bufPosOut;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue