This DCHECK is for the 'new and improved' way of setting thread priority.
What could happen is that code that's migrating over to the new method
might still have a lingering SetPriority call, that could incorrectly bind the
'spawned_thread_checker_' to the construction thread.
BUG=none
Review-Url: https://codereview.webrtc.org/2753423002
Cr-Commit-Position: refs/heads/master@{#17305}
This adds a simple mechanism that provides protection against
implementations that use the legacy callback type in PlatformThread
and are prone to entering a busy loop.
Enabled only in DCHECK enabled builds.
BUG=webrtc:7187
Review-Url: https://codereview.webrtc.org/2720223003
Cr-Commit-Position: refs/heads/master@{#16973}
Reason for revert:
breaks linux_ubsan bots.
Original issue's description:
> Reland of Use sched_yield on all POSIX platforms in PlatformThread. (patchset #1 id:1 of https://codereview.webrtc.org/2712133003/ )
>
> Reason for revert:
> Relanding - using sched_yield() in PlatformThread on all posix platforms.
>
> Original issue's description:
> > Revert of Use sched_yield on all POSIX platforms in PlatformThread. (patchset #1 id:1 of https://codereview.webrtc.org/2716683002/ )
> >
> > Reason for revert:
> > Reverting this change since it didn't affect the perf regressions we were seeing and actually seems to have caused more regressions as per comment in the bug.
> >
> > Original issue's description:
> > > Use sched_yield on all POSIX platforms in PlatformThread.
> > > (not only MacOS)
> > >
> > > This is a test to see if perf regressions we're seeing may be related to the use of nanosleep().
> > >
> > > BUG=695438
> > > TBR=solenberg@webrtc.org
> > >
> > > Review-Url: https://codereview.webrtc.org/2716683002 .
> > > Cr-Commit-Position: refs/heads/master@{#16807}
> > > Committed: 384498abb5
> >
> > TBR=solenberg@webrtc.org
> > # Skipping CQ checks because original CL landed less than 1 days ago.
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > NOTRY=true
> > BUG=695438
> >
> > Review-Url: https://codereview.webrtc.org/2712133003
> > Cr-Commit-Position: refs/heads/master@{#16833}
> > Committed: 3ba1a8cd1b
>
> TBR=solenberg@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=695438
>
> Review-Url: https://codereview.webrtc.org/2725573002
> Cr-Commit-Position: refs/heads/master@{#16899}
> Committed: 4974df4183TBR=solenberg@webrtc.org,tommi@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=695438
Review-Url: https://codereview.webrtc.org/2721893002
Cr-Commit-Position: refs/heads/master@{#16903}
Reason for revert:
Relanding - using sched_yield() in PlatformThread on all posix platforms.
Original issue's description:
> Revert of Use sched_yield on all POSIX platforms in PlatformThread. (patchset #1 id:1 of https://codereview.webrtc.org/2716683002/ )
>
> Reason for revert:
> Reverting this change since it didn't affect the perf regressions we were seeing and actually seems to have caused more regressions as per comment in the bug.
>
> Original issue's description:
> > Use sched_yield on all POSIX platforms in PlatformThread.
> > (not only MacOS)
> >
> > This is a test to see if perf regressions we're seeing may be related to the use of nanosleep().
> >
> > BUG=695438
> > TBR=solenberg@webrtc.org
> >
> > Review-Url: https://codereview.webrtc.org/2716683002 .
> > Cr-Commit-Position: refs/heads/master@{#16807}
> > Committed: 384498abb5
>
> TBR=solenberg@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=695438
>
> Review-Url: https://codereview.webrtc.org/2712133003
> Cr-Commit-Position: refs/heads/master@{#16833}
> Committed: 3ba1a8cd1bTBR=solenberg@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=695438
Review-Url: https://codereview.webrtc.org/2725573002
Cr-Commit-Position: refs/heads/master@{#16899}
Reason for revert:
Reverting this change since it didn't affect the perf regressions we were seeing and actually seems to have caused more regressions as per comment in the bug.
Original issue's description:
> Use sched_yield on all POSIX platforms in PlatformThread.
> (not only MacOS)
>
> This is a test to see if perf regressions we're seeing may be related to the use of nanosleep().
>
> BUG=695438
> TBR=solenberg@webrtc.org
>
> Review-Url: https://codereview.webrtc.org/2716683002 .
> Cr-Commit-Position: refs/heads/master@{#16807}
> Committed: 384498abb5TBR=solenberg@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=695438
Review-Url: https://codereview.webrtc.org/2712133003
Cr-Commit-Position: refs/heads/master@{#16833}
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}
- name(): Returns the name of the thread (useful for debugging).
- GetThreadRef(): Returns the ID of the worker thread (also useful for debugging).
- QueueApc(): This is a Windows-only, protected function that allows derived classes on Windows to queue APCs to the worker thread.
NOTRY=true
(using notry since the patch has already passed the trybots and the cq is currently stalled)
Review URL: https://codereview.webrtc.org/1908373002
Cr-Commit-Position: refs/heads/master@{#12472}
Real time clock may cause problems as they can move (even backwards) if
the clock is changed, eg updated by NTP.
Non-monotonic clocks still in use on some platform (I'm looking at you,
Apple) for timed waits, but that should be less of an issue than actual
timestamps.
BUG=webrtc:5452
Review URL: https://codereview.webrtc.org/1613013002
Cr-Commit-Position: refs/heads/master@{#11375}
* Move PlatformThread to rtc::.
* Remove ::CreateThread factory method.
* Make non-scoped_ptr from a lot of invocations.
* Make Start/Stop void.
* Remove rtc::Thread priorities, which were unused and would collide.
* Add ::IsRunning() to PlatformThread.
BUG=
R=tommi@webrtc.org
Review URL: https://codereview.webrtc.org/1476453002 .
Cr-Commit-Position: refs/heads/master@{#10812}
Also removes all virtual methods. Permits using a thread from
rtc_base_approved (namely event tracing).
BUG=webrtc:5158
R=tommi@webrtc.org
Review URL: https://codereview.webrtc.org/1469013002
Cr-Commit-Position: refs/heads/master@{#10760}
We must remove dependency on Chromium, i.e. we can't use Chromium's base/logging.h. That means we need to define these macros in WebRTC also when doing Chromium builds. And this causes redefinition.
Alternative solutions:
* Check if we already have defined e.g. CHECK, and don't define them in that case. This makes us depend on include order in Chromium, which is not acceptable.
* Don't allow using the macros in WebRTC headers. Error prone since if someone adds it there by mistake it may compile fine, but later break if a header in added or order is changed in Chromium. That will be confusing and hard to enforce.
* Ensure that headers that are included by an embedder don't include our macros. This would require some heavy refactoring to be maintainable and enforcable.
* Changes in Chromium for this is obviously not an option.
BUG=chromium:468375
NOTRY=true
Review URL: https://codereview.webrtc.org/1335923002
Cr-Commit-Position: refs/heads/master@{#9964}