Change in vdsm[master]: misc: Remove mysterious wrong code

nsoffer at redhat.com nsoffer at redhat.com
Wed Jun 11 15:46:26 UTC 2014


Nir Soffer has uploaded a new change for review.

Change subject: misc: Remove mysterious wrong code
......................................................................

misc: Remove mysterious wrong code

When a thread wakes up after waiting for a condition inside the barrier,
this means that some other thread just released the lock, and this
thread should now return False, signaling the caller that the barrier
was busy.

Instead, the current code is trying to lock the barrier again, and
return True if succeeded, or wait again until the condition is notified.
I could not explain this code and it looks wrong, so I removed it.  It
is possible that I don't understand how this code should work.

Change-Id: Ia803b3169893d7107882b15d0b031c36ec2ef250
Signed-off-by: Nir Soffer <nsoffer at redhat.com>
---
M vdsm/storage/misc.py
1 file changed, 0 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/10/28610/1

diff --git a/vdsm/storage/misc.py b/vdsm/storage/misc.py
index b03eb68..adbfb39 100644
--- a/vdsm/storage/misc.py
+++ b/vdsm/storage/misc.py
@@ -680,14 +680,6 @@
             while self._busy:
                 self._cond.wait()
 
-            if self._lock.acquire(False):
-                assert self._busy is False
-                self._busy = True
-                return True
-
-            while self._busy:
-                self._cond.wait()
-
             return False
         finally:
             self._cond.release()


-- 
To view, visit http://gerrit.ovirt.org/28610
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia803b3169893d7107882b15d0b031c36ec2ef250
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>


More information about the vdsm-patches mailing list