diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-22 23:44:17 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-22 23:44:17 +0000 |
commit | 6b0c55fedf749639458e222887da22fb604ba62d (patch) | |
tree | d8b8cc8942a322ea79de5e6173e4acad23c5879c /base | |
parent | 9fe9ec2e360b0c61bbdb134fc63cc4fc5af36da1 (diff) | |
download | chromium_src-6b0c55fedf749639458e222887da22fb604ba62d.zip chromium_src-6b0c55fedf749639458e222887da22fb604ba62d.tar.gz chromium_src-6b0c55fedf749639458e222887da22fb604ba62d.tar.bz2 |
ThreadRestrictions: inline function definitions in Release mode
This prevents symbol conflicts when the header is #included from
multiple sources.
TEST=no compile errors in debug or release modes
Review URL: http://codereview.chromium.org/3999006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63596 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/thread_restrictions.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/base/thread_restrictions.h b/base/thread_restrictions.h index 4aa2cd6..c0fee58 100644 --- a/base/thread_restrictions.h +++ b/base/thread_restrictions.h @@ -23,6 +23,8 @@ namespace base { // class ThreadRestrictions { public: + +#ifndef NDEBUG // Set whether the current thread to make IO calls. // Threads start out in the *allowed* state. static void SetIOAllowed(bool allowed); @@ -30,18 +32,17 @@ class ThreadRestrictions { // Check whether the current thread is allowed to make IO calls, // and DCHECK if not. static void AssertIOAllowed(); +#else + // In Release builds, inline the empty definitions of these functions so + // that they can be compiled out. + static void SetIOAllowed(bool allowed) {} + static void AssertIOAllowed() {} +#endif private: ThreadRestrictions(); // class for namespacing only }; -// In Release builds, inline the empty definitions of these functions so -// that they can be compiled out. -#ifdef NDEBUG -void ThreadRestrictions::SetIOAllowed(bool allowed) {} -void ThreadRestrictions::AssertIOAllowed() {} -#endif - } // namespace base #endif // BASE_THREAD_RESTRICTIONS_H_ |