Dan Kenigsberg has posted comments on this change. Change subject: misc: Simplify DynamicBarrier implemenation ......................................................................
Patch Set 4: (1 comment) http://gerrit.ovirt.org/#/c/29003/4/vdsm/storage/misc.py File vdsm/storage/misc.py: Line 652: Line 653: class DynamicBarrier(object): Line 654: def __init__(self): Line 655: self._cond = threading.Condition() Line 656: self._busy = False > i don't understand the reason for the lock, why wasn't it a boolean at firs The idiom if not flag: flag = True cries "look for races here"; I suppose that it was avoided due to that. But as explained in the commit message, `with self.cond` makes this idiom save in our case. Line 657: Line 658: def enter(self): Line 659: """ Line 660: Enter the dynamic barrier. Returns True if you should be -- To view, visit http://gerrit.ovirt.org/29003 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia403cd9f734eaafdce95ba5123e54ec4e4939172 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer <[email protected]> Gerrit-Reviewer: Allon Mureinik <[email protected]> Gerrit-Reviewer: Dan Kenigsberg <[email protected]> Gerrit-Reviewer: Federico Simoncelli <[email protected]> Gerrit-Reviewer: Nir Soffer <[email protected]> Gerrit-Reviewer: Saggi Mizrahi <[email protected]> Gerrit-Reviewer: Yaniv Bronhaim <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
