summaryrefslogtreecommitdiffstats
path: root/sandbox/src
diff options
context:
space:
mode:
authorcpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-08 21:29:43 +0000
committercpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-08 21:29:43 +0000
commitdf91e5742b0e11bda7e605167d0f5554ab27dcf3 (patch)
tree86a4b3df2da00bca8fe74a9eb31819159c0984a2 /sandbox/src
parentf460cc8c601dc33138e32a94a2285ab9c587a7a0 (diff)
downloadchromium_src-df91e5742b0e11bda7e605167d0f5554ab27dcf3.zip
chromium_src-df91e5742b0e11bda7e605167d0f5554ab27dcf3.tar.gz
chromium_src-df91e5742b0e11bda7e605167d0f5554ab27dcf3.tar.bz2
Klocwork bug. The dtor of Win2kThreadpool needs to be virtual since
the object is destroyed thru the base. - Removed UnRegisterWait loop in dtor. BUG=3108 Review URL: http://codereview.chromium.org/6247 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3057 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox/src')
-rw-r--r--sandbox/src/crosscall_server.h9
-rw-r--r--sandbox/src/win2k_threadpool.cc18
-rw-r--r--sandbox/src/win2k_threadpool.h10
3 files changed, 14 insertions, 23 deletions
diff --git a/sandbox/src/crosscall_server.h b/sandbox/src/crosscall_server.h
index fdd2177..9d2052f 100644
--- a/sandbox/src/crosscall_server.h
+++ b/sandbox/src/crosscall_server.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef SANDBOX_SRC_CROSSCALL_SERVER_H__
-#define SANDBOX_SRC_CROSSCALL_SERVER_H__
+#ifndef SANDBOX_SRC_CROSSCALL_SERVER_H_
+#define SANDBOX_SRC_CROSSCALL_SERVER_H_
#include <string>
#include <vector>
@@ -78,6 +78,7 @@ class ThreadProvider {
// Removes all the registrations done with the same cookie parameter.
// This frees internal thread pool resources.
virtual bool UnRegisterWaits(void* cookie) = 0;
+ virtual ~ThreadProvider() {}
};
// Models the server-side of the original input parameters.
@@ -120,7 +121,7 @@ class CrossCallParamsEx : public CrossCallParams {
CrossCallParamsEx();
ParamInfo param_info_[1];
- DISALLOW_EVIL_CONSTRUCTORS(CrossCallParamsEx);
+ DISALLOW_COPY_AND_ASSIGN(CrossCallParamsEx);
};
// Simple helper function that sets the members of CrossCallReturn
@@ -214,5 +215,5 @@ class Dispatcher {
} // namespace sandbox
-#endif // SANDBOX_SRC_CROSSCALL_SERVER_H__
+#endif // SANDBOX_SRC_CROSSCALL_SERVER_H_
diff --git a/sandbox/src/win2k_threadpool.cc b/sandbox/src/win2k_threadpool.cc
index e25c904..296ec379 100644
--- a/sandbox/src/win2k_threadpool.cc
+++ b/sandbox/src/win2k_threadpool.cc
@@ -56,19 +56,9 @@ size_t Win2kThreadPool::OutstandingWaits() {
}
Win2kThreadPool::~Win2kThreadPool() {
- // time to close all the pool wait handles. This frees the thread pool so
- // it can throttle down the number of 'ready' threads.
- AutoLock lock(&lock_);
- PoolObjects::iterator it;
- for (it = pool_objects_.begin(); it != pool_objects_.end(); ++it) {
- if (0 != it->cookie) {
- if (FALSE == ::UnregisterWait(it->wait)) {
- NOTREACHED();
- }
- it->cookie = 0;
- }
- }
+ // Here we used to unregister all the pool wait handles. Now, following the
+ // rest of the code we avoid lengthy or blocking calls given that the process
+ // is being torn down.
}
-} // namespace sandbox
-
+} // namespace sandbox \ No newline at end of file
diff --git a/sandbox/src/win2k_threadpool.h b/sandbox/src/win2k_threadpool.h
index 0b0a319..81c6d10 100644
--- a/sandbox/src/win2k_threadpool.h
+++ b/sandbox/src/win2k_threadpool.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef SANDBOX_SRC_WIN2K_THREADPOOL_H__
-#define SANDBOX_SRC_WIN2K_THREADPOOL_H__
+#ifndef SANDBOX_SRC_WIN2K_THREADPOOL_H_
+#define SANDBOX_SRC_WIN2K_THREADPOOL_H_
#include <list>
#include <algorithm>
@@ -27,7 +27,7 @@ class Win2kThreadPool : public ThreadProvider {
Win2kThreadPool() {
::InitializeCriticalSection(&lock_);
}
- ~Win2kThreadPool();
+ virtual ~Win2kThreadPool();
virtual bool RegisterWait(const void* client, HANDLE waitable_object,
CrossCallIPCCallback callback,
@@ -50,10 +50,10 @@ class Win2kThreadPool : public ThreadProvider {
PoolObjects pool_objects_;
// This lock protects the list of pool wait objects.
CRITICAL_SECTION lock_;
- DISALLOW_EVIL_CONSTRUCTORS(Win2kThreadPool);
+ DISALLOW_COPY_AND_ASSIGN(Win2kThreadPool);
};
} // namespace sandbox
-#endif // SANDBOX_SRC_WIN2K_THREADPOOL_H__
+#endif // SANDBOX_SRC_WIN2K_THREADPOOL_H_