dirmgr: Make store be in an Arc

This will let us share it with the bridge descriptor manager.
(As discussed with Nick.)
This commit is contained in:
Ian Jackson 2022-11-03 18:15:38 +00:00
parent 9a285ec4ad
commit dcdd8053b4
1 changed files with 2 additions and 2 deletions

View File

@ -236,7 +236,7 @@ pub struct DirMgr<R: Runtime> {
// TODO(nickm): I'd like to use an rwlock, but that's not feasible, since
// rusqlite::Connection isn't Sync.
// TODO is needed?
store: Mutex<DynStore>,
store: Arc<Mutex<DynStore>>,
/// Our latest sufficiently bootstrapped directory, if we have one.
///
/// We use the RwLock so that we can give this out to a bunch of other
@ -848,7 +848,7 @@ impl<R: Runtime> DirMgr<R> {
Ok(DirMgr {
config: config.into(),
store,
store: store.into(),
netdir,
default_parameters,
events,