diff options
author | deanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-22 17:22:49 +0000 |
---|---|---|
committer | deanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-22 17:22:49 +0000 |
commit | 6413906c119090aa5d8ec4abfa83a6b65b51d404 (patch) | |
tree | 6090c413b02467b4a40f6d0bcc8ae75914972b2a /base/platform_thread.h | |
parent | fe6135245ee7254459e37ae8663c2c98146e8d3c (diff) | |
download | chromium_src-6413906c119090aa5d8ec4abfa83a6b65b51d404.zip chromium_src-6413906c119090aa5d8ec4abfa83a6b65b51d404.tar.gz chromium_src-6413906c119090aa5d8ec4abfa83a6b65b51d404.tar.bz2 |
Properly initialize PlatformThreadHandle. The Open Group Base Specifications Issue 6 states that pthread_t cannot be assumed to be a numeric type. It should be safe to value initialize it with (), even if it's a structure.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1226 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/platform_thread.h')
-rw-r--r-- | base/platform_thread.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/base/platform_thread.h b/base/platform_thread.h index 542716b..1feb72d 100644 --- a/base/platform_thread.h +++ b/base/platform_thread.h @@ -32,8 +32,10 @@ #include "base/basictypes.h" -// PlatformThreadHandle should be a numeric type on all platforms, so it can -// be initialized to 0. However, 0 cannot be assumed to be an invalid handle. +// PlatformThreadHandle should not be assumed to be a numeric type, since the +// standard intends to allow pthread_t to be a structure. This means you +// should not initialize it to a value, like 0. If it's a member variable, the +// constructor can safely "value initialize" using () in the initializer list. #if defined(OS_WIN) typedef void* PlatformThreadHandle; // HANDLE #elif defined(OS_POSIX) |