Skip to content
Permalink
Browse files
2010-10-27 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
        Reviewed by Tony Chang.

        [NRWT] Fix http lock on Windows platform
        https://bugs.webkit.org/show_bug.cgi?id=48321

        * Scripts/webkitpy/layout_tests/port/http_lock.py:

Canonical link: https://commits.webkit.org/61193@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@70672 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
webkit-commit-queue committed Oct 27, 2010
1 parent 5e33109 commit ecc703e51d27daa01da0518e5faa0d630b7ccc27
Showing 2 changed files with 20 additions and 13 deletions.
@@ -1,3 +1,12 @@
2010-10-27 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>

Reviewed by Tony Chang.

[NRWT] Fix http lock on Windows platform
https://bugs.webkit.org/show_bug.cgi?id=48321

* Scripts/webkitpy/layout_tests/port/http_lock.py:

2010-10-27 Satish Sampath <satish@chromium.org>

Unreviewed, rolling out r70665.
@@ -71,13 +71,15 @@ def _next_lock_number(self):
return self._extract_lock_number(lock_list[-1]) + 1

def _check_pid(self, current_pid):
"""Return True if pid is alive, otherwise return False."""
try:
os.kill(current_pid, 0)
except OSError:
return False
else:
return True
"""Return True if pid is alive, otherwise return False.
FIXME: os.kill() doesn't work on Windows for checking if
a pid is alive, so always return True"""
if sys.platform in ('darwin', 'linux2'):
try:
os.kill(current_pid, 0)
except OSError:
return False
return True

def _curent_lock_pid(self):
"""Return with the current lock pid. If the lock is not valid
@@ -89,9 +91,7 @@ def _curent_lock_pid(self):
current_lock_file = open(lock_list[0], 'r')
current_pid = current_lock_file.readline()
current_lock_file.close()
if not (current_pid and
sys.platform in ('darwin', 'linux2') and
self._check_pid(int(current_pid))):
if not (current_pid and self._check_pid(int(current_pid))):
os.unlink(lock_list[0])
return
except IOError, OSError:
@@ -104,9 +104,7 @@ def _create_lock_file(self):
numbers are sequential."""
while(True):
try:
sequential_guard_lock = os.open(self._guard_lock_file,
os.O_CREAT | os.O_NONBLOCK | os.O_EXCL)

sequential_guard_lock = os.open(self._guard_lock_file, os.O_CREAT | os.O_EXCL)
self._process_lock_file_name = (self._lock_file_path_prefix +
str(self._next_lock_number()))
lock_file = open(self._process_lock_file_name, 'w')

0 comments on commit ecc703e

Please sign in to comment.