OSDN Git Service

Always check result of Thread::ModifySuspendCount
authorSebastien Hertz <shertz@google.com>
Fri, 14 Apr 2017 13:05:12 +0000 (15:05 +0200)
committerSebastien Hertz <shertz@google.com>
Tue, 18 Apr 2017 16:06:54 +0000 (18:06 +0200)
commit1c8f4ff04062407db3d2dd834dd6bc24f6662c4d
treea116c7d55fc1bcff2b451028f46a1196ee15d990
parentc1be9f2b776b4900e0603013f7c4d84e534f0bb0
Always check result of Thread::ModifySuspendCount

Ensures that we never ignore the result of ModifySuspendCount so that
we can react if the suspend count is not updated as expected.

This CL does the following:
* Adds __attribute__((warn_unused_result)) on the method to raise an
  error at compilation time if the result is ignored.
* Wraps calls with DCHECK where the result used to be ignored.

Bug: 27385848
Test: make -j test-art-host
Test: art/tools/run-jdwp-tests.sh --mode=host --variant=X64
Change-Id: I2d0e1ab7158c70ec8076c8bae6e4b814aee75af6
runtime/thread.cc
runtime/thread.h
runtime/thread_list.cc