Introduce a new constructor to PlatformThread.

The new constructor introduces two new changes:

* Support specifying thread priority at construction time.
  - Moving forward, the SetPriority() method will be removed.
* New thread function type.
  - The new type has 'void' as a return type and a polling loop
    inside PlatformThread, is not used.

The old function type is still supported until all places have been moved over.

In this CL, the first steps towards deprecating the old mechanism are taken
by moving parts of the code that were simple to move, over to the new callback
type.

BUG=webrtc:7187

Review-Url: https://codereview.webrtc.org/2708723003
Cr-Commit-Position: refs/heads/master@{#16779}
This commit is contained in:
tommi
2017-02-22 11:22:05 -08:00
committed by Commit bot
parent 6d230d7b1d
commit 0f8b403eb5
20 changed files with 258 additions and 169 deletions

View File

@ -197,7 +197,7 @@ class TestFrameBuffer2 : public ::testing::Test {
ASSERT_FALSE(frames_[index]);
}
static bool ExtractLoop(void* obj) {
static void ExtractLoop(void* obj) {
TestFrameBuffer2* tfb = static_cast<TestFrameBuffer2*>(obj);
while (true) {
tfb->trigger_extract_event_.Wait(rtc::Event::kForever);
@ -205,7 +205,7 @@ class TestFrameBuffer2 : public ::testing::Test {
rtc::CritScope lock(&tfb->crit_);
tfb->crit_acquired_event_.Set();
if (tfb->tear_down_)
return false;
return;
std::unique_ptr<FrameObject> frame;
FrameBuffer::ReturnReason res =