summaryrefslogtreecommitdiffstats
path: root/libutils
diff options
context:
space:
mode:
Diffstat (limited to 'libutils')
-rw-r--r--libutils/Threads.cpp2
-rw-r--r--libutils/tests/Looper_test.cpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/libutils/Threads.cpp b/libutils/Threads.cpp
index 6dda6b573..def739f9f 100644
--- a/libutils/Threads.cpp
+++ b/libutils/Threads.cpp
@@ -668,6 +668,8 @@ status_t Thread::readyToRun()
status_t Thread::run(const char* name, int32_t priority, size_t stack)
{
+ LOG_ALWAYS_FATAL_IF(name == nullptr, "thread name not provided to Thread::run");
+
Mutex::Autolock _l(mLock);
if (mRunning) {
diff --git a/libutils/tests/Looper_test.cpp b/libutils/tests/Looper_test.cpp
index 00077e676..17319e03f 100644
--- a/libutils/tests/Looper_test.cpp
+++ b/libutils/tests/Looper_test.cpp
@@ -138,7 +138,7 @@ TEST_F(LooperTest, PollOnce_WhenNonZeroTimeoutAndAwokenBeforeWaiting_Immediately
TEST_F(LooperTest, PollOnce_WhenNonZeroTimeoutAndAwokenWhileWaiting_PromptlyReturns) {
sp<DelayedWake> delayedWake = new DelayedWake(100, mLooper);
- delayedWake->run();
+ delayedWake->run("LooperTest");
StopWatch stopWatch("pollOnce");
int result = mLooper->pollOnce(1000);
@@ -251,7 +251,7 @@ TEST_F(LooperTest, PollOnce_WhenNonZeroTimeoutAndSignalledFDWhileWaiting_Promptl
sp<DelayedWriteSignal> delayedWriteSignal = new DelayedWriteSignal(100, & pipe);
handler.setCallback(mLooper, pipe.receiveFd, Looper::EVENT_INPUT);
- delayedWriteSignal->run();
+ delayedWriteSignal->run("LooperTest");
StopWatch stopWatch("pollOnce");
int result = mLooper->pollOnce(1000);