Pool local store connections

This commit is contained in:
Eelco Dolstra
2016-02-20 00:04:08 +01:00
parent 1cefd6cac8
commit 88a05763cc
6 changed files with 38 additions and 17 deletions
+3 -1
View File
@@ -5,6 +5,7 @@
#include "lru-cache.hh"
#include "sync.hh"
#include "pool.hh"
#include <atomic>
@@ -15,7 +16,8 @@ struct NarInfo;
/* While BinaryCacheStore is thread-safe, LocalStore and RemoteStore
aren't. Until they are, use a factory to produce a thread-local
local store. */
typedef std::function<ref<Store>()> StoreFactory;
typedef Pool<nix::ref<nix::Store>> StorePool;
typedef std::function<StorePool::Handle()> StoreFactory;
class BinaryCacheStore : public Store
{