Commit 895d5c16 authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

Make writeConfigAndUnlock unlock while writing out



Make the combined write-and-unlock functionality of WConfD
already unlock the configuration after it is changed in
memory; only return once the actual write out is finished.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarPetr Pudlak <pudlak@google.com>
parent 25fc9f85
...@@ -125,7 +125,9 @@ unlockConfig cid = freeLocksLevel cid LevelConfig ...@@ -125,7 +125,9 @@ unlockConfig cid = freeLocksLevel cid LevelConfig
-- | Write the configuration, verifying the config lock is held exclusively, -- | Write the configuration, verifying the config lock is held exclusively,
-- and release the config lock. -- and release the config lock.
writeConfigAndUnlock :: ClientId -> ConfigData -> WConfdMonad () writeConfigAndUnlock :: ClientId -> ConfigData -> WConfdMonad ()
writeConfigAndUnlock cid cdata = writeConfig cid cdata >> unlockConfig cid writeConfigAndUnlock cid cdata = do
checkConfigLock cid L.OwnExclusive
CW.writeConfigWithImmediate cdata $ unlockConfig cid
-- | Force the distribution of configuration without actually modifying it. -- | Force the distribution of configuration without actually modifying it.
-- It is not necessary to hold a lock for this operation. -- It is not necessary to hold a lock for this operation.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment