OSDN Git Service

Prevent ArtMethod clearing race
authorMathieu Chartier <mathieuc@google.com>
Wed, 11 May 2016 01:13:20 +0000 (18:13 -0700)
committerMathieu Chartier <mathieuc@google.com>
Wed, 11 May 2016 16:56:42 +0000 (09:56 -0700)
commit10c5f56423feaf3eadb3d4c09c61d2b998404162
tree95ff81b9106f5425e9903e5239ccf410aa8bc3ea
parent718d4e269810c17d03df909c84b2f7bbd4f61fb9
Prevent ArtMethod clearing race

There was race condition where the GC would be visiting the methods
of a class while the class linker overwrote the contents with 0xFE
when copying to a new array.

Since the GC is holding the class table lock at this time, we can
use this lock in the class linker to prevent the race.

Bug: 28699001
Change-Id: I91ca2406ef723e7be69cd1c53f4bafa2e5f63657
runtime/class_linker.cc
runtime/class_linker.h
runtime/class_table.h