make shutdown safe for double calls.
- In new shutdown sequence, volume shutdown is requested in two places: system_server and init. - Make VolumeManager.shutdown safe for double calls. It crashed before this change. bug: 36004738 Test: reboot and check last_kmsg for crash / vdc timeout Change-Id: I296913959b2647b65d66553073f2032545beba57
This commit is contained in:
parent
92f21f5294
commit
a5bbb5e3c1
1 changed files with 5 additions and 0 deletions
|
@ -633,8 +633,13 @@ int VolumeManager::reset() {
|
|||
return 0;
|
||||
}
|
||||
|
||||
// Can be called twice (sequentially) during shutdown. should be safe for that.
|
||||
int VolumeManager::shutdown() {
|
||||
if (mInternalEmulated == nullptr) {
|
||||
return 0; // already shutdown
|
||||
}
|
||||
mInternalEmulated->destroy();
|
||||
mInternalEmulated = nullptr;
|
||||
for (const auto& disk : mDisks) {
|
||||
disk->destroy();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue