Refactor mutex, library loader and complement Windows thread API

Signed-off-by: huangyu <huangyu76@huawei.com>
Change-Id: I662463d239f6d050ef6908de70e0e98cf85bf2a6
This commit is contained in:
huangyu
2022-06-10 16:25:49 +08:00
parent 633c83d2b0
commit f76f983336
19 changed files with 395 additions and 296 deletions
+8
View File
@@ -36,7 +36,11 @@ using TaggedType = coretypes::TaggedType;
bool ManagedThread::is_initialized = false;
mem::TLAB *ManagedThread::zero_tlab = nullptr;
#ifdef PANDA_TARGET_UNIX
static const int MIN_PRIORITY = 19;
#elif PANDA_TARGET_WINDOWS
static const int MIN_PRIORITY = -2;
#endif
MTManagedThread::ThreadId MTManagedThread::GetInternalId()
{
@@ -454,7 +458,11 @@ void ManagedThread::SetThreadPriority(int32_t prio)
{
ThreadId tid = GetId();
int res = os::thread::SetPriority(tid, prio);
#ifdef PANDA_TARGET_UNIX
if (res == 0) {
#elif PANDA_TARGET_WINDOWS
if (res != 0) {
#endif
LOG(DEBUG, RUNTIME) << "Successfully changed priority for thread " << tid << " to " << prio;
} else {
LOG(DEBUG, RUNTIME) << "Cannot change priority for thread " << tid << " to " << prio;