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

Issue 18677: Use PlatformThreadId, not int when dealing with thread ids. (Closed)

Created:
11 years, 11 months ago by agl
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Use PlatformThreadId, not int when dealing with thread ids. Windows uses a DWORD (unsigned long) for thread ids and POSIX uses a pid_t (int on Linux) for the same. In the code, we are currently stuffing thread ids into an int which is dangerous on Windows (because DWORDS can exceed an int and wrap) and will break if pid_t is ever != int. This change changes all the places where we currently have an int to use a new typedef, PlatformThreadId. This change also needs to occur for process ids, but I'm not doing that in this CL.

Patch Set 1 #

Total comments: 6

Patch Set 2 : addressing comments #

Total comments: 4

Patch Set 3 : addressing comments #

Total comments: 2

Patch Set 4 : Addressing comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -16 lines) Patch
M base/message_pump_glib.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/non_thread_safe.h View 2 chunks +2 lines, -1 line 0 comments Download
M base/platform_thread.h View 1 2 3 1 chunk +10 lines, -1 line 0 comments Download
M base/platform_thread_posix.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M base/platform_thread_win.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M base/simple_thread.h View 2 chunks +2 lines, -2 lines 0 comments Download
M base/stats_table.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M base/thread.h View 2 chunks +2 lines, -2 lines 0 comments Download
M base/thread_collision_warner.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M base/thread_collision_warner.cc View 1 2 3 2 chunks +13 lines, -2 lines 0 comments Download
M net/url_request/url_request_job_manager.h View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 7 (0 generated)
John Grabowski
Thanks for following up here. http://codereview.chromium.org/18677/diff/1/4 File base/platform_thread.h (right): http://codereview.chromium.org/18677/diff/1/4#newcode24 Line 24: typedef pid_t PlatformThreadId; ...
11 years, 11 months ago (2009-01-22 20:35:40 UTC) #1
agl
http://codereview.chromium.org/18677/diff/1/4 File base/platform_thread.h (right): http://codereview.chromium.org/18677/diff/1/4#newcode24 Line 24: typedef pid_t PlatformThreadId; On 2009/01/22 20:35:40, John Grabowski ...
11 years, 11 months ago (2009-01-22 20:42:46 UTC) #2
agl
11 years, 11 months ago (2009-01-22 20:43:35 UTC) #3
John Grabowski
LGTM http://codereview.chromium.org/18677/diff/15/18 File base/platform_thread.h (right): http://codereview.chromium.org/18677/diff/15/18#newcode28 Line 28: #elif defined(OS_POSIX) OS_POSIX --> OS_MACOSX. It's the ...
11 years, 11 months ago (2009-01-22 20:53:53 UTC) #4
agl
thanks John. http://codereview.chromium.org/18677/diff/15/18 File base/platform_thread.h (right): http://codereview.chromium.org/18677/diff/15/18#newcode28 Line 28: #elif defined(OS_POSIX) On 2009/01/22 20:53:53, John ...
11 years, 11 months ago (2009-01-22 21:15:38 UTC) #5
darin (slow to review)
http://codereview.chromium.org/18677/diff/215/31 File base/platform_thread.h (right): http://codereview.chromium.org/18677/diff/215/31#newcode26 Line 26: #include <unistd.h> style nit: it is not common ...
11 years, 11 months ago (2009-01-22 23:36:25 UTC) #6
agl
11 years, 11 months ago (2009-01-22 23:57:55 UTC) #7
http://codereview.chromium.org/18677/diff/215/31
File base/platform_thread.h (right):

http://codereview.chromium.org/18677/diff/215/31#newcode26
Line 26: #include <unistd.h>
On 2009/01/22 23:36:25, darin wrote:
> style nit: it is not common in chrome code to indent includes, and this
> indentation is not consistent with the #elif defined(OS_POSIX) section above.

Indentation removed.

Powered by Google App Engine
This is Rietveld 408576698