Fix static lib crash by setting top init_priority

Set top init_priority on affecting global variables so that
they will be created firstly and destroyed lastly.

Change-Id: Ied59fbecab66ba8195c4a7a02b6bef9fa2fad3af
This commit is contained in:
Tao Sang authored and Tao Sang committed 2020-07-06 16:54:10 -04:00
1 förälder 2c551e44cc
incheckning f7bf882981
4 files changed
+12 -8

No files matched your search

+2 -2
Visa fil
@@ -1430,8 +1430,8 @@ void Image::Format::formatColor(const void* colorRGBA, void* colorFormat) const
}
}
std::map<uintptr_t, uintptr_t> SvmBuffer::Allocated_;
Monitor SvmBuffer::AllocatedLock_("Guards SVM allocation list");
Monitor SvmBuffer::AllocatedLock_ ROCCLR_INIT_PRIORITY(101) ("Guards SVM allocation list");
std::map<uintptr_t, uintptr_t> SvmBuffer::Allocated_ ROCCLR_INIT_PRIORITY(101);
void SvmBuffer::Add(uintptr_t k, uintptr_t v) {
ScopedLock lock(AllocatedLock_);