summaryrefslogtreecommitdiff
path: root/runtime/thread_pool.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/thread_pool.cc')
-rw-r--r--runtime/thread_pool.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/thread_pool.cc b/runtime/thread_pool.cc
index d9d2ea31a2..d9179c3892 100644
--- a/runtime/thread_pool.cc
+++ b/runtime/thread_pool.cc
@@ -21,6 +21,8 @@
#include <sys/time.h>
#include <sys/resource.h>
+#include "android-base/stringprintf.h"
+
#include "base/bit_utils.h"
#include "base/casts.h"
#include "base/logging.h"
@@ -31,6 +33,8 @@
namespace art {
+using android::base::StringPrintf;
+
static constexpr bool kMeasureWaitTime = false;
ThreadPoolWorker::ThreadPoolWorker(ThreadPool* thread_pool, const std::string& name,
@@ -86,6 +90,8 @@ void* ThreadPoolWorker::Callback(void* arg) {
Runtime* runtime = Runtime::Current();
CHECK(runtime->AttachCurrentThread(worker->name_.c_str(), true, nullptr, false));
worker->thread_ = Thread::Current();
+ // Thread pool workers cannot call into java.
+ worker->thread_->SetCanCallIntoJava(false);
// Do work until its time to shut down.
worker->Run();
runtime->DetachCurrentThread();