Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Issue 48123: Added a wait with timeout to the platform semaphore class (Closed)

Created:
11 years, 9 months ago by Søren Thygesen Gjesse
Modified:
9 years, 7 months ago
Reviewers:
Erik Corry
CC:
v8-dev
Visibility:
Public.

Description

Added a wait with timeout to the platform semaphore class. The code has been compiled and tested on Windows, Linux and Mac OS. The FreeBSD version is a copy of the Linux version which should work on FreeBSD as well. According to the FreeBSD documentation clock_gettime is part of the standard C library so the assumption is that no additional link libraries is required for FreeBSD. Committed: http://code.google.com/p/v8/source/detail?r=1526

Patch Set 1 #

Total comments: 8

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+120 lines, -5 lines) Patch
M SConstruct View 4 chunks +4 lines, -4 lines 0 comments Download
M src/platform.h View 1 1 chunk +7 lines, -1 line 0 comments Download
M src/platform-freebsd.cc View 1 2 chunks +35 lines, -0 lines 0 comments Download
M src/platform-linux.cc View 1 2 chunks +35 lines, -0 lines 0 comments Download
M src/platform-macos.cc View 1 2 chunks +10 lines, -0 lines 0 comments Download
M src/platform-win32.cc View 1 1 chunk +6 lines, -0 lines 0 comments Download
M test/cctest/test-lock.cc View 1 1 chunk +23 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Søren Thygesen Gjesse
11 years, 9 months ago (2009-03-18 08:07:25 UTC) #1
Erik Corry
LGTM http://codereview.chromium.org/48123/diff/1/5 File src/platform-linux.cc (right): http://codereview.chromium.org/48123/diff/1/5#newcode612 Line 612: // Split timeout into seconds and nanoseconds ...
11 years, 9 months ago (2009-03-18 08:34:23 UTC) #2
Søren Thygesen Gjesse
11 years, 9 months ago (2009-03-18 09:03:32 UTC) #3
http://codereview.chromium.org/48123/diff/1/5
File src/platform-linux.cc (right):

http://codereview.chromium.org/48123/diff/1/5#newcode612
Line 612: // Split timeout into seconds and nanoseconds parts.
On 2009/03/18 08:34:23, Erik Corry wrote:
> seconds and nanoseconds -> second and nanosecond

Done.

http://codereview.chromium.org/48123/diff/1/5#newcode622
Line 622: // Calculate realtime for end of timeout.
On 2009/03/18 08:34:23, Erik Corry wrote:
> real time twowords.

Done.

http://codereview.chromium.org/48123/diff/1/7
File src/platform.h (right):

http://codereview.chromium.org/48123/diff/1/7#newcode420
Line 420: // true is returned. The timeout value is specified in miiliseconds.
On 2009/03/18 08:34:23, Erik Corry wrote:
> I would prefer microseconds.

Changed API to use microseconds.

http://codereview.chromium.org/48123/diff/1/2
File test/cctest/test-lock.cc (right):

http://codereview.chromium.org/48123/diff/1/2#newcode48
Line 48: ok = sem->Wait(1000);
On 2009/03/18 08:34:23, Erik Corry wrote:
> Please reduce the length of this wait so the tests continue to run fast.

With API at microseconds I kept 1000, and added tests for 0 and 100 as well.

Powered by Google App Engine
This is Rietveld 408576698