Revert "Use std::unique_ptr instead of ScopeGuard"
Revert submission 2780893
Reason for revert: breaking boot tests
Bug: 308214260
Reverted changes: /q/submissionid:2780893
Change-Id: I7a4ee9a45583a8a1d4a33447de55c63e6ce9d42a
diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp
index ff8aa83..8ec4af9 100644
--- a/libs/binder/ProcessState.cpp
+++ b/libs/binder/ProcessState.cpp
@@ -19,9 +19,9 @@
#include <binder/ProcessState.h>
#include <android-base/result.h>
+#include <android-base/scopeguard.h>
#include <android-base/strings.h>
#include <binder/BpBinder.h>
-#include <binder/Functional.h>
#include <binder/IPCThreadState.h>
#include <binder/IServiceManager.h>
#include <binder/Stability.h>
@@ -60,8 +60,6 @@
namespace android {
-using namespace android::binder::impl;
-
class PoolThread : public Thread
{
public:
@@ -432,7 +430,7 @@
size_t ProcessState::getThreadPoolMaxTotalThreadCount() const {
pthread_mutex_lock(&mThreadCountLock);
- auto detachGuard = make_scope_guard([&]() { pthread_mutex_unlock(&mThreadCountLock); });
+ base::ScopeGuard detachGuard = [&]() { pthread_mutex_unlock(&mThreadCountLock); };
if (mThreadPoolStarted) {
LOG_ALWAYS_FATAL_IF(mKernelStartedThreads > mMaxThreads + 1,