-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chromium/base: Port thread support to OS/2.
Needed for #3.
- Loading branch information
Showing
4 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright 2020 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "base/threading/platform_thread.h" | ||
|
||
#include "base/threading/platform_thread_internal_posix.h" | ||
#include "base/threading/thread_id_name_manager.h" | ||
|
||
namespace base { | ||
|
||
namespace internal { | ||
|
||
// kLIBC maps nice values to OS/2 priorities in __libc_back_priorityOS2FromUnix, | ||
// consult it for details. | ||
const ThreadPriorityToNiceValuePair kThreadPriorityToNiceValueMap[4] = { | ||
{ThreadPriority::BACKGROUND, 20}, // PRTYC_IDLETIME + 0 | ||
{ThreadPriority::NORMAL, 0}, // PRTYC_REGULAR + 0 | ||
{ThreadPriority::DISPLAY, -10}, // PRTYC_FOREGROUNDSERVER + 0 | ||
{ThreadPriority::REALTIME_AUDIO, -18}, // PRTYC_TIMECRITICAL + 0 | ||
}; | ||
|
||
} // namespace internal | ||
|
||
void InitThreading() {} | ||
|
||
void TerminateOnThread() {} | ||
|
||
size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) { | ||
return 0; | ||
} | ||
|
||
// static | ||
void PlatformThread::SetName(const std::string& name) { | ||
ThreadIdNameManager::GetInstance()->SetName(name); | ||
} | ||
|
||
} // namespace base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters