Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions ocaml/libs/ezxenstore/watch/ez_xenstore_watch.ml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ module Make (Debug : DEBUG) = struct
in
List.map fst (IntMap.bindings c)

let need_refresh_domains = Atomic.make false

let mark_refresh_domains () = Atomic.set need_refresh_domains true

let with_xc_and_xs f =
Xenctrl.with_intf (fun xc -> with_xs (fun xs -> f xc xs))

Expand Down Expand Up @@ -196,9 +200,13 @@ module Make (Debug : DEBUG) = struct
in

let process_one_watch c (path, _token) =
if path = _introduceDomain || path = _releaseDomain then
look_for_different_domains ()
else
if
Atomic.exchange need_refresh_domains false
|| path = _introduceDomain
|| path = _releaseDomain
then
look_for_different_domains () ;
if path <> _introduceDomain && path <> _releaseDomain then
Client.immediate c (fun h ->
let xs = Xs.ops h in
Actions.watch_fired xc xs path !domains !watches
Expand Down
Loading
Loading