mirror of
https://github.com/NixOS/nix.git
synced 2025-12-24 01:41:08 +01:00
GitFileSystemObjectSink: Fix crash during interrupt
This commit is contained in:
parent
97e3816b24
commit
6bea8e0e08
2 changed files with 13 additions and 2 deletions
|
|
@ -1094,6 +1094,13 @@ struct GitFileSystemObjectSinkImpl : GitFileSystemObjectSink
|
|||
{
|
||||
}
|
||||
|
||||
~GitFileSystemObjectSinkImpl()
|
||||
{
|
||||
// Make sure the worker threads are destroyed before any state
|
||||
// they're referring to.
|
||||
workers.shutdown();
|
||||
}
|
||||
|
||||
struct Child;
|
||||
|
||||
/// A directory to be written as a Git tree.
|
||||
|
|
|
|||
|
|
@ -52,6 +52,12 @@ public:
|
|||
*/
|
||||
void process();
|
||||
|
||||
/**
|
||||
* Shut down all worker threads and wait until they've exited.
|
||||
* Active work items are finished, but any pending work items are discarded.
|
||||
*/
|
||||
void shutdown();
|
||||
|
||||
private:
|
||||
|
||||
size_t maxThreads;
|
||||
|
|
@ -72,8 +78,6 @@ private:
|
|||
std::condition_variable work;
|
||||
|
||||
void doWork(bool mainThread);
|
||||
|
||||
void shutdown();
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue