Tommi
ea14f0ac11
Move SetCurrentThreadName to platform_thread.* in rtc_base_approved,
...
update all webrtc and libjingle code to use the same function and remove
extra implementations.
BUG=
R=andresp@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/55439004
Cr-Commit-Position: refs/heads/master@{#9205}
2015-05-18 11:50:31 +00:00
tommi@webrtc.org
a3ffc56cee
Allow setting thread priorities in Chromium on all but linux platforms.
...
The previous check was overly broad, so narrowing it down to linux only.
R=pbos@webrtc.org
BUG=
Review URL: https://webrtc-codereview.appspot.com/43929004
Cr-Commit-Position: refs/heads/master@{#8837}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8837 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-23 20:11:45 +00:00
tommi@webrtc.org
1596a4f88b
Temporarily disable SetPriority when building with Chromium.
...
This is due to errors we were hitting with Chromium's sandbox policy for pthread_setschedparam.
R=magjed@webrtc.org , pbos@webrtc.org
BUG=
Review URL: https://webrtc-codereview.appspot.com/45839004
Cr-Commit-Position: refs/heads/master@{#8829}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8829 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-23 12:39:38 +00:00
tommi@webrtc.org
38492c5b6f
Re-land 8810 "- Add a SetPriority method to ThreadWr..."
...
> Revert 8810 "- Add a SetPriority method to ThreadWrapper"
> Seeing if this is causing roll issues.
>
> > - Add a SetPriority method to ThreadWrapper
> > - Remove 'priority' from CreateThread and related member variables from implementations
> > - Make supplying a name for threads, non-optional
> >
> > BUG=
> > R=magjed@webrtc.org
> >
> > Review URL: https://webrtc-codereview.appspot.com/44729004
>
> TBR=tommi@webrtc.org
>
> Review URL: https://webrtc-codereview.appspot.com/48609004
TBR=tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/50459005
Cr-Commit-Position: refs/heads/master@{#8819}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8819 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-22 14:42:46 +00:00
tommi@webrtc.org
90a1cb4630
Revert 8810 "- Add a SetPriority method to ThreadWrapper"
...
Seeing if this is causing roll issues.
> - Add a SetPriority method to ThreadWrapper
> - Remove 'priority' from CreateThread and related member variables from implementations
> - Make supplying a name for threads, non-optional
>
> BUG=
> R=magjed@webrtc.org
>
> Review URL: https://webrtc-codereview.appspot.com/44729004
TBR=tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/48609004
Cr-Commit-Position: refs/heads/master@{#8818}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8818 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-22 14:34:46 +00:00
tommi@webrtc.org
b6817d793f
- Add a SetPriority method to ThreadWrapper
...
- Remove 'priority' from CreateThread and related member variables from implementations
- Make supplying a name for threads, non-optional
BUG=
R=magjed@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/44729004
Cr-Commit-Position: refs/heads/master@{#8810}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8810 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-20 15:52:43 +00:00
tommi@webrtc.org
27c0be9dfe
Remove ThreadObj #define and kThreadMaxNameLength from thread_wrapper.
...
BUG=
R=hbos@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/47679004
Cr-Commit-Position: refs/heads/master@{#8792}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8792 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-19 14:36:43 +00:00
tommi@webrtc.org
aba9219e5c
Change ThreadPosix to use an auto-reset event instead of manual reset now that we know the problem we had with EventWrapper::Wait was simply a bug in the EventWrapper. Also removing |started_| since we can just check the thread_ instead.
...
R=pbos@webrtc.org
BUG=4413
Review URL: https://webrtc-codereview.appspot.com/47539004
Cr-Commit-Position: refs/heads/master@{#8738}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8738 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-16 16:06:16 +00:00
pbos@webrtc.org
86639737b8
Remove thread id from ThreadWrapper::Start().
...
Removes ThreadPosix::InitParams and a corresponding wait for an event.
This unblocks ThreadPosix::Start which had to wait for thread scheduling
for an event to trigger on the spawned thread, giving faster Start()
calls.
BUG=4413
R=tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/43699004
Cr-Commit-Position: refs/heads/master@{#8709}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8709 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-13 00:07:45 +00:00
tommi@webrtc.org
11c5db01af
Revert 8273 "Temporarily change ThreadPosix to CHECK (crash) if ..."
...
> Temporarily change ThreadPosix to CHECK (crash) if we ever spend more than 30 seconds waiting for thread shutdown. There are cases on build bots where it looks like we're hitting this problem, but reproducing locally has been a struggle.
>
> TBR=pbos@webrtc.org
>
> Review URL: https://webrtc-codereview.appspot.com/41799004
TBR=tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/38039004
Cr-Commit-Position: refs/heads/master@{#8300}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8300 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-09 16:31:54 +00:00
tommi@webrtc.org
d0165c62b5
Use a manual reset event in PosixThread.
...
This fixes occasional hangs we've been seeing in the past few days. I'm using rtc::Event instead of the EventWrapper, so I'll wait with landing this cl until I've made that change in a separate cl.
BUG=2822,4282
R=pbos@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/38009004
Cr-Commit-Position: refs/heads/master@{#8293}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8293 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-09 11:48:13 +00:00
tommi@webrtc.org
ccd7e99f0a
Temporarily change ThreadPosix to CHECK (crash) if we ever spend more than 30 seconds waiting for thread shutdown. There are cases on build bots where it looks like we're hitting this problem, but reproducing locally has been a struggle.
...
TBR=pbos@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/41799004
Cr-Commit-Position: refs/heads/master@{#8273}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8273 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-06 19:27:12 +00:00
tommi@webrtc.org
875c97ed9d
Remove SetNotAlive method from the thread class.
...
Also cleaning up methods with the same name in other classes that are derived from the above method.
R=perkj@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/41759004
Cr-Commit-Position: refs/heads/master@{#8242}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8242 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-04 11:12:39 +00:00
tommi@webrtc.org
d43bdf50c5
Rewrite ThreadPosix.
...
This is the same change as already made for Windows:
https://webrtc-codereview.appspot.com/37069004/
* Remove "dead" and "alive" variables.
* Remove critical section
* Remove implementation of SetNotAlive()
* Always set thread name
* Add thread checks for correct usage.
* Changed AudioDeviceMac to create/start/stop/delete thread objects for playout and recording, inside the respective start and stop method. The reason for this is because the AudioDeviceMac instance is currently being created on one thread and the above Start/Stop methods are being called on a different thread. So, my change makes creation, start/stop, deletion of the thread objects always happen on the same thread.
I'm making CurrentThreadId() in rtc_base_approved more visible so that it can be used from there instead of inside webrtc. Down the line we will have more thread concepts in rtc_base_approved, so I put a TODO for myself to move this functionality to there once we do.
R=henrika@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/40599004
Cr-Commit-Position: refs/heads/master@{#8235}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8235 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-03 16:30:21 +00:00
tommi@webrtc.org
2bbc35d896
Remove unused method, SetAffinity, from the ThreadWrapper class.
...
The method was also not consistently implemented across all platforms.
R=pbos@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/33169004
Cr-Commit-Position: refs/heads/master@{#8212}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8212 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-01-30 09:43:20 +00:00
henrike@webrtc.org
ea6c12e59f
Set thread scheduling parameters inside the new thread.
...
This makes it possible to restrict threads from modifying scheduling
parameters of another thread in the Chrome Linux sandbox.
BUG=
R=henrike@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/28539004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7324 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-09-29 18:25:27 +00:00
pbos@webrtc.org
d900e8bea8
Proper spacing for end-of-namespace comments.
...
BUG=
R=mflodman@webrtc.org , tina.legrand@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/1760006
git-svn-id: http://webrtc.googlecode.com/svn/trunk@4293 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-07-03 15:12:26 +00:00
pbos@webrtc.org
acaf3a1b13
Include files from webrtc/.. paths in system_wrappers/
...
BUG=1662
R=henrikg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/1550004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@4111 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-05-27 15:07:45 +00:00
hta@webrtc.org
2cec0b1670
Cleanup nanosleep -> SleepMs
...
Remove some leftover stuff
BUG=603
TEST=
Review URL: https://webrtc-codereview.appspot.com/672005
git-svn-id: http://webrtc.googlecode.com/svn/trunk@3700 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-03-21 14:02:29 +00:00
henrike@webrtc.org
57e6b81954
Mac 64-bit compatibility for WebRTC.
...
pthread_t is a pointer type on Mac OS X, and is thus 32 bits wide in the
32-bit environment and 64 bits wide in the 64-bit environment. WebRTC's
thread ID routines assume that thread IDs can always fit inside a uint32_t,
but this is not the case in the 64-bit Mac environment when using pthread_t
as the basis for a thread ID. Instead, switch to using the underlying Mach
port for the thread, which is a 32-bit quantity in both the 32-bit and 64-bit
environments.
The only place this seems to be used is in TraceImpl::AddThreadId, and it's
only used there for a thread ID for display.
This is a better fix than https://webrtc-codereview.appspot.com/929015 .
Review URL: https://webrtc-codereview.appspot.com/1063005
git-svn-id: http://webrtc.googlecode.com/svn/trunk@3427 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-01-29 15:08:29 +00:00
henrike@webrtc.org
a3e6bec23a
Posix Thread: Removes the setting of the run function to NULL which could cause data race.
...
BUG=http://code.google.com/p/chromium/issues/detail?id=103711
TESTED=Code analysis (no tools)
Review URL: https://webrtc-codereview.appspot.com/1008006
git-svn-id: http://webrtc.googlecode.com/svn/trunk@3388 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-01-18 16:39:21 +00:00
phoglund@webrtc.org
ec9c942e45
Reformatted thread and static_instance.
...
BUG=
TEST=Trybots.
Review URL: https://webrtc-codereview.appspot.com/1006005
git-svn-id: http://webrtc.googlecode.com/svn/trunk@3324 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-01-02 08:45:03 +00:00
thakis@chromium.org
6e470076ef
mac: Fix a port leak in threading code.
...
Chromium got the same fix in https://codereview.chromium.org/9169016/ 10 months ago.
Review URL: https://webrtc-codereview.appspot.com/929015
git-svn-id: http://webrtc.googlecode.com/svn/trunk@3080 4adac7df-926f-26a2-2b94-8c16560cd09d
2012-11-12 18:30:59 +00:00
tommi@webrtc.org
b952a90038
Remove an unused Shutdown method from the ThreadWrapper interface.
...
The method was flagged by Chrome engineers as dubious since it uses
TerminateThread. As it turns out, we don't use this method anywhere,
so we can simply remove it! :)
BUG=1066
Review URL: https://webrtc-codereview.appspot.com/938012
git-svn-id: http://webrtc.googlecode.com/svn/trunk@3065 4adac7df-926f-26a2-2b94-8c16560cd09d
2012-11-08 13:40:59 +00:00
andrew@webrtc.org
14b43beb7c
Move src/ -> webrtc/
...
TBR=niklas.enbom@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/915006
git-svn-id: http://webrtc.googlecode.com/svn/trunk@2963 4adac7df-926f-26a2-2b94-8c16560cd09d
2012-10-22 18:19:23 +00:00