mirror of
https://github.com/NixOS/nix
synced 2025-06-29 02:11:15 +02:00
SSHMaster: Make thread-safe
This commit is contained in:
parent
d3eb1cf3bb
commit
8490ee37a6
2 changed files with 29 additions and 17 deletions
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "util.hh"
|
||||
#include "sync.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
@ -8,13 +9,19 @@ class SSHMaster
|
|||
{
|
||||
private:
|
||||
|
||||
std::string host;
|
||||
std::string keyFile;
|
||||
bool useMaster;
|
||||
bool compress;
|
||||
Pid sshMaster;
|
||||
std::unique_ptr<AutoDelete> tmpDir;
|
||||
Path socketPath;
|
||||
const std::string host;
|
||||
const std::string keyFile;
|
||||
const bool useMaster;
|
||||
const bool compress;
|
||||
|
||||
struct State
|
||||
{
|
||||
Pid sshMaster;
|
||||
std::unique_ptr<AutoDelete> tmpDir;
|
||||
Path socketPath;
|
||||
};
|
||||
|
||||
Sync<State> state_;
|
||||
|
||||
public:
|
||||
|
||||
|
@ -34,8 +41,7 @@ public:
|
|||
|
||||
std::unique_ptr<Connection> startCommand(const std::string & command);
|
||||
|
||||
void startMaster();
|
||||
|
||||
Path startMaster();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue