Граф коммитов

157 Коммитов

Автор SHA1 Сообщение Дата
Andreas Farre cf4cd748f1 Bug 1292600 - Add telemetry to measure how idle budgets are used. r=froydnj, data-r=bsmedberg 2017-06-07 16:14:42 +02:00
Ehsan Akhgari 19d6dc61bb Bug 1368286 - Take the idle queue into account in nsThread::HasPendingEvents(); r=smaug 2017-06-06 12:37:27 -04:00
Bill McCloskey 226f6b9185 Bug 1366869 - Make DISPATCH_NORMAL be the default flags argument for nsIEventTarget::Dispatch (r=froydnj)
MozReview-Commit-ID: 5DVcIaMHH95
2017-05-23 12:05:43 -07:00
Bill McCloskey 71bfb5a04b Bug 1351021 - Compute mean time between unlabeled (r=froydnj,data-r=bsmedberg)
Accumulates the time in between running unlabeled runnables in a histogram. This
measurement will be useful to see how much of a win the cooperative scheduler
will be, assuming we label no more runnables.

MozReview-Commit-ID: 9lgoGJcXLP9
2017-05-17 11:47:40 -07:00
Markus Stange 8924022f9d Bug 1323100 - Add nsThreadManager::NewNamedThread API. r=froydnj
The point of this exercise is to make the thread name available in the thread
func of the thread, so that we can register the thread with the profiler from
the very start of its lifetime, and so that registration and unregistration
can be inside the same function.

MozReview-Commit-ID: DiiMKUQVr55

--HG--
extra : rebase_source : 24b15d56315ad49e72b3e9b76db7fb634f3bfe01
2016-12-20 15:10:20 +01:00
Olli Pettay cb803253a5 bug 1306591, add secondary event queue to let high priority messages to be processed sooner, r=billm
--HG--
extra : rebase_source : 2ce6e06783e399e787d0445943f9f39bcef1cc22
2016-11-08 14:05:45 +02:00
Andreas Farre 3aecf57375 Bug 1198381 - Implement the requestIdleCallback feature, r=froydnj,mattwoodrow,smaug
Expose requestIdleCallback on Window and implement running callbacks
in idle periods by posting rICs to the main threads idle queue.

MozReview-Commit-ID: KSYQsyaZ6is

--HG--
extra : rebase_source : 6abd41c2de96b39004f1b2c3c740e81de570970c
2016-08-22 14:52:45 +02:00
Andreas Farre d87b4d239b Bug 1198381 - Extend nsIThread with idleDispatch, r=froydnj,smaug
The intent of idleDispatch is the possibility to have a runnable
executed when the thread is idle. This is accomplished by adding an
event queue for idle tasks that will only be considered when the main
event queue is empty and the caller of ProcessNextEvent doesn't
require that we wait until there is an event on the main event queue.

MozReview-Commit-ID: IDWQfzZqWpZ

--HG--
extra : rebase_source : 0d5bfeebd08e01597c2cd8b76e8e848d9f9c58f0
2016-08-24 16:18:06 +02:00
Carsten "Tomcat" Book e42af6918c Backed out changeset 333a899fb5e6 (bug 1198381) 2016-10-25 12:32:56 +02:00
Carsten "Tomcat" Book 1895ce466b Backed out changeset eb2606332cb8 (bug 1198381) 2016-10-25 12:32:54 +02:00
Andreas Farre 1380385c69 Bug 1198381 - Implement the requestIdleCallback feature, r=froydnj,mattwoodrow,smaug
Expose requestIdleCallback on Window and implement running callbacks
in idle periods by posting rICs to the main threads idle queue.

MozReview-Commit-ID: KSYQsyaZ6is

--HG--
extra : rebase_source : 4bdd578b654d05cab600489d30d859452d1bc888
2016-08-22 14:52:45 +02:00
Andreas Farre 60a3a10742 Bug 1198381 - Extend nsIThread with idleDispatch, r=froydnj,smaug
The intent of idleDispatch is the possibility to have a runnable
executed when the thread is idle. This is accomplished by adding an
event queue for idle tasks that will only be considered when the main
event queue is empty and the caller of ProcessNextEvent doesn't
require that we wait until there is an event on the main event queue.

MozReview-Commit-ID: IDWQfzZqWpZ

--HG--
extra : rebase_source : b16ff65d7a9b2fa16216a9ce8756358014d7ad96
2016-08-24 16:18:06 +02:00
Eric Faust 121151ec67 Bug 1263595 - Avoid deadlock between the JIT and the gecko profiler on win64. (r=froydnj) 2016-09-15 21:35:14 -07:00
Wes Kocher 611fb66887 Backed out changeset 39da44265946 (bug 1263595) for build bustage a=backout CLOSED TREE 2016-09-16 14:19:22 -07:00
Eric Faust db0cfdc6bc Bug 1263595 - Avoid deadlock between the JIT and the gecko profiler on win64. (r=froydnj) 2016-09-15 21:35:14 -07:00
Phil Ringnalda 6beabc555f Backed out changeset 48694b762a84 (bug 1263595) for -Werror bustage
CLOSED TREE
2016-09-15 22:04:50 -07:00
Eric Faust c725e729c5 Bug 1263595 - Avoid deadlock between the JIT and the gecko profiler on win64. (r=froydnj) 2016-09-15 21:35:14 -07:00
Jan de Mooij a53986bf29 Bug 1302448 part 1 - Rename CycleCollectedJSRuntime to CycleCollectedJSContext. r=mccr8
--HG--
rename : xpcom/base/CycleCollectedJSRuntime.cpp => xpcom/base/CycleCollectedJSContext.cpp
rename : xpcom/base/CycleCollectedJSRuntime.h => xpcom/base/CycleCollectedJSContext.h
extra : rebase_source : 075214b5057f151520926715b6154e99ae80a0b3
2016-09-14 15:47:32 +02:00
Kirk Steuber 5b3eba1f2b Bug 1263774 - Include memory reports in content process crash reports. r=mccr8, r=aklotz
MozReview-Commit-ID: 7y3GFBZxjsS

--HG--
extra : rebase_source : 9d5aaaa6caad336c85c42002df321b382c90c8a9
2016-06-21 11:45:25 -07:00
Xidorn Quan 5c01d7c3ee Bug 1276549 - Remove rvalue reference mark for already_AddRefed params of nsIEventTarget::Dispatch and related methods. r=froydnj
MozReview-Commit-ID: J5RAfGW3X7T

--HG--
extra : source : e1ff4b0d5d9d2599ac00bac376597357ffd58ce0
2016-06-01 10:04:54 +10:00
Nicholas Nethercote 19c16a645a Bug 1272203 (part 2) - Use NotNull in nsThread. r=froydnj. 2016-05-27 09:49:23 +10:00
Kyle Huey eacb809d5f Bug 1274114: Factor out main thread specific parts of event processing. r=froydnj 2016-05-22 08:30:03 -04:00
Kyle Huey a80e57e854 Bug 1204784: Do not shut the main thread down before all outstanding asynchronous thread shutdowns complete. r=froydnj
--HG--
extra : rebase_source : 9f4c8a219e2fa6dfbfec78f9f390726f2f07f683
2016-01-18 09:34:38 -08:00
Xidorn Quan f569fa65f9 Bug 1238404 - Use 'using' directive instead of having separate Dispatch impl in subclasses of nsIEventTarget. r=froydnj
--HG--
extra : source : 76255b192a7d6dae74f19c68653537d5f8f39775
2016-01-12 15:18:47 +11:00
Nathan Froyd 01583602a9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00
Xidorn Quan d98cc8899a Bug 1186745 part 2 - Move nsThreadSyncDispatch class to its own header file. r=froydnj
--HG--
extra : source : ec17a3b46e134cbf99a74d581a89d7dea10f0af0
2015-10-06 13:00:59 +11:00
Wes Kocher 1d312920f4 Backed out 6 changesets (bug 1186745) for android Cpp failures
Backed out changeset 237a6acf0709 (bug 1186745)
Backed out changeset 7b530871783a (bug 1186745)
Backed out changeset 73f73b531fc8 (bug 1186745)
Backed out changeset e36909748ddf (bug 1186745)
Backed out changeset 3a31df8787f0 (bug 1186745)
Backed out changeset df9cb8f5f0a5 (bug 1186745)
2015-10-02 10:35:09 -07:00
Xidorn Quan 21fa30d414 Bug 1186745 part 2 - Move nsThreadSyncDispatch class to its own header file. r=froydnj
--HG--
extra : source : c92a7df2cc4043cb2795a0c4b085283165287973
2015-10-03 00:18:24 +10:00
Phil Ringnalda c096566a7e Back out 6 changesets (bug 1186745) for cpptest failure in runnable_utils_unittest, nrappkit_unittest, test_nr_socket_unittest
Backed out changeset c6142b815de0 (bug 1186745)
Backed out changeset d8f740ef2430 (bug 1186745)
Backed out changeset edc0b56d81fa (bug 1186745)
Backed out changeset 383f8ac033ea (bug 1186745)
Backed out changeset ce960a661987 (bug 1186745)
Backed out changeset 3e9783023fb2 (bug 1186745)

--HG--
extra : rebase_source : 4681d6abaaa927ddb863f944efc87e6c6f6c2e26
2015-09-28 19:05:02 -07:00
Xidorn Quan 5a61756f88 Bug 1186745 part 2 - Move nsThreadSyncDispatch class to its own header file. r=froydnj
--HG--
extra : source : ae110eaaa626064dd81188d4f587a2df1f439bd2
2015-09-29 09:28:22 +10:00
Nathan Froyd 8bb05ee37e Bug 1202497 - follow-up - fix static analysis bustage; r=me 2015-09-22 19:25:37 -04:00
Nathan Froyd 3eae8069d0 Bug 1202497 - part 7 - make nsEventQueue use external locking; r=gerald
We want to ensure that nsThread's use of nsEventQueue uses locking done
in nsThread instead of nsEventQueue, for efficiency's sake: we only need
to lock once in nsThread, rather than the current situation of locking
in nsThread and additionally in nsEventQueue.  With the current
structure of nsEventQueue, that would mean that nsThread should be using
a Monitor internally, rather than a Mutex.

Which would be well and good, except that DOM workers use nsThread's
mutex to protect their own, internal CondVar.  Switching nsThread to use
a Monitor would mean that either:

- DOM workers drop their internal CondVar in favor of nsThread's
  Monitor-owned CondVar.  This change seems unlikely to work out well,
  because now the Monitor-owned CondVar is performing double duty:
  tracking availability of events in nsThread's event queue and
  additionally whatever DOM workers were using a CondVar for.  Having a
  single CondVar track two things in such a fashion is for Experts Only.

- DOM workers grow their own Mutex to protect their own CondVar.  Adding
  a mutex like this would change locking in subtle ways and seems
  unlikely to lead to success.

Using a Monitor in nsThread is therefore untenable, and we would like to
retain the current Mutex that lives in nsThread.  Therefore, we need to
have nsEventQueue manage its own condition variable and push the
required (Mutex) locking to the client of nsEventQueue.  This scheme
also seems more fitting: external clients merely need synchronized
access to the event queue; the details of managing notifications about
events in the event queue should be left up to the event queue itself.

Doing so also forces us to merge nsEventQueueBase and nsEventQueue:
there's no way to have nsEventQueueBase require an externally-defined
Mutex and then have nsEventQueue subclass nsEventQueueBase and provide
its own Mutex to the superclass.  C++ initialization rules (and the way
things like CondVar are constructed) simply forbid it.  But that's OK,
because we want a world where nsEventQueue is externally locked anyway,
so there's no reason to have separate classes here.

One casualty of this work is removing ChaosMode support from
nsEventQueue.  nsEventQueue had support to delay placing events into the
queue, theoretically giving other threads the chance to put events there
first.  Unfortunately, since the thread would have been holding a lock
(as is evident from the MutexAutoLock& parameter required), sleeping in
PutEvent accomplishes nothing but delaying the thread from getting
useful work done.  We should support this, but it's complicated to
figure out how to reasonably support this right now.

A wrinkle in this overall pleasant refactoring is that nsThreadPool's
threads wait for limited amounts of time for new events to be placed in
the event queue, so that they can shut themselves down if no new events
are appearing.  Setting limits on the number of threads also needs to be
able to wake up all threads, so threads can shut themselves down if
necessary.

Unfortunately, with the transition to nsEventQueue managing its own
condition variable, there's no way for nsThreadPool to perform these
functions, since there's no Monitor to wait on.  Therefore, we add a
private API for accessing the condition variable and performing the
tasks nsThreadPool needs.

Prior to all the previous patches, placing items in an nsThread's event
queue required three lock/unlock pairs: one for nsThread's Mutex, one to
enter nsEventQueue's ReentrantMonitor, and one to exit nsEventQueue's
ReentrantMonitor.  The upshot of all this work is that we now only
require one lock/unlock pair in nsThread itself, as things should be.
2015-09-20 05:13:09 -04:00
Nathan Froyd c6238d0d96 Bug 1202497 - part 6 - make the locking requirements of nsEventQueue explicit; r=gerald
Like the previous patch, this patch is a no-op change in terms of
functionality.  It does, however, pave part of the way for forcing
clients of nsEventQueue to provide their own locking.
2015-09-21 04:34:51 -04:00
Nathan Froyd 2c79a08dbd Bug 1202497 - part 5 - make the locking requirements of nsChainedEventQueue explicit; r=gerald
This patch is a no-op in terms of functionality.  It ensures that we're
always holding nsThread's mutex when we touch mEvents, as dictated by
the comments.  Putting this addition into its own patch will help make
the change to having nsEventQueue by guarded by a Mutex, rather than a
Monitor, somewhat clearer.
2015-09-20 04:59:56 -04:00
Nathan Froyd 90bdddcda8 Bug 1202497 - part 3 - remove nsThread::GetEvent; r=gerald
GetEvent was only called from one place, so it wasn't terribly useful as
an abstraction.  It also broke the invariant that we protect accesses to
mEvents with mLock, as documented in nsThread.h.  While upcoming patches
could have just updated GetEvent to do the necessary locking on its own,
it seemed just as easy to make the locking requirements at the callsite,
as will be done for other accesses to mEvents.
2015-09-20 04:44:51 -04:00
Kyle Huey 0efe211e55 Bug 1200922: Add the ability to shut down a thread asynchronously. r=froydnj 2015-09-14 18:24:43 -07:00
Kyle Huey 76e3009ab8 Bug 1179909: Refactor stable state handling. r=smaug
This is motivated by three separate but related problems:

1. Our concept of recursion depth is broken for things that run from AfterProcessNextEvent observers (e.g. Promises). We decrement the recursionDepth counter before firing observers, so a Promise callback running at the lowest event loop depth has a recursion depth of 0 (whereas a regular nsIRunnable would be 1). This is a problem because it's impossible to distinguish a Promise running after a sync XHR's onreadystatechange handler from a top-level event (since the former runs with depth 2 - 1 = 1, and the latter runs with just 1).

2. The nsIThreadObserver mechanism that is used by a lot of code to run "after" the current event is a poor fit for anything that runs script. First, the order the observers fire in is the order they were added, not anything fixed by spec. Additionally, running script can cause the event loop to spin, which is a big source of pain here (bholley has some nasty bug caused by this).

3. We run Promises from different points in the code for workers and main thread. The latter runs from XPConnect's nsIThreadObserver callbacks, while the former runs from a hardcoded call to run Promises in the worker event loop. What workers do is particularly problematic because it means we can't get the right recursion depth no matter what we do to nsThread.

The solve this, this patch does the following:

1. Consolidate some handling of microtasks and all handling of stable state from appshell and WorkerPrivate into CycleCollectedJSRuntime.
2. Make the recursionDepth counter only available to CycleCollectedJSRuntime (and its consumers) and remove it from the nsIThreadInternal and nsIThreadObserver APIs.
3. Adjust the recursionDepth counter so that microtasks run with the recursionDepth of the task they are associated with.
4. Introduce the concept of metastable state to replace appshell's RunBeforeNextEvent. Metastable state is reached after every microtask or task is completed. This provides the semantics that bent and I want for IndexedDB, where transactions autocommit at the end of a microtask and do not "spill" from one microtask into a subsequent microtask. This differs from appshell's RunBeforeNextEvent in two ways:
a) It fires between microtasks, which was the motivation for starting this.
b) It no longer ensures that we're at the same event loop depth in the native event queue. bent decided we don't care about this.
5. Reorder stable state to happen after microtasks such as Promises, per HTML. Right now we call the regular thread observers, including appshell, before the main thread observer (XPConnect), so stable state tasks happen before microtasks.
2015-08-11 06:10:46 -07:00
Randell Jesup c87c478f4f Bug 1155059: Patch 1&2 - Convert Dispatch() and friends to already_AddRefed<> r=froydnj
Modify Dispatch IDL and code to deal with MSVC issues with overloaded templates r=froydnj
2015-07-09 23:21:46 -04:00
Cervantes Yu 55152ad9d9 Backout change 39e167bbd14c, a80140872ea5, adae9be2294d and b71ccef9c674 (bug 970307). 2015-05-19 14:31:25 +08:00
Carsten "Tomcat" Book 005c5ce415 Backed out changeset 4d2839eea957 (bug 970307) 2015-05-19 11:44:27 +02:00
Cervantes Yu a12ce249b1 Backout change 39e167bbd14c, a80140872ea5, adae9be2294d and b71ccef9c674 (bug 970307).
--HG--
extra : rebase_source : 829e80228e07440285383316d2c4fea017828529
2015-05-19 14:31:25 +08:00
Nathan Froyd ddbb44d13f Bug 1158320 - rename nsThread::mRunningEvent to mNestedEventLoopDepth; r=bsmedberg
The current name reads to me like a boolean variable, even though it's
actually a counter.  Try to make that property more explicit at its uses
by renaming it to something more evocative of counter-ness.
2015-04-24 16:04:50 -04:00
Ehsan Akhgari 883849ee32 Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04:00
Chih-Kai (Patrick) Wang fcb6d29268 Bug 970307: Part 1: Report status of each thread to find when all the threads are idle. r=nfroyd 2014-12-18 17:00:39 +08:00
Ryan VanderMeulen fb8d05cd59 Backed out changesets 9beb53e53951, 4420bb4e5e7c, de1da65301a8, and cd9c2aaf1343 (bug 970307) for causing frequent B2G debug mochitest-11 crashes. 2014-11-24 17:18:27 -05:00
Patrick Wang (Chih-Kai Wang) c0da861aa4 Bug 970307: Part 1: Report status of each thread to find when all the threads are idle. r=nfroyd 2014-11-24 15:21:52 +08:00
Birunthan Mohanathas c9fb2c0d48 Bug 1022456 - Fix modelines in xpcom/{base,glue,io,string,threads}/. r=froydnj 2014-06-30 08:39:45 -07:00
Birunthan Mohanathas 67dad11bae Bug 995730 - Convert xpcom/threads/ to Gecko style. r=froydnj
--HG--
extra : rebase_source : 1f6f179f44db87f55ebfe5d855192adfad7d1b74
2014-05-27 10:15:35 +03:00
Kyle Huey 7af104c03a Bug 996132: Make allocations in the event queue infallible. r=bsmedberg 2014-05-23 12:53:14 -07:00
Olli Pettay e84a8e90a5 Backout Bug 953435 to fix bug 959281, a=backout 2014-02-02 20:12:27 +02:00
Olli Pettay 5cdea8d914 Bug 953435 - Browser hang on Mac if an AfterProcessNextEvent callback tries to spin the event loop, r=nfroyd+smichaud
--HG--
extra : rebase_source : e999d852f5f73b18f37ff6a5488cc171c95d9e61
2014-01-09 00:10:06 +02:00
Ben Turner 2e75b22c85 Bug 914762 - Allow nsThread to be subclassed, r=bsmedberg.
--HG--
extra : transplant_source : %BD%C5%CB%7Fx%82q%FC%B6%AA%8B%8E%9Fo%BE%82%DE%09h%FF
2013-11-14 10:06:21 -08:00
Ben Turner 3233aad341 Bug 939196 - Allow nsThread to have nested event queues, r=bsmedberg.
--HG--
extra : transplant_source : %DE%AF%BF%7E%94%5E%07%CDL%9C%01%28%9F6%8D%90%12%95%06s
2013-11-14 10:06:17 -08:00
Trevor Saunders 7d09aa8e5c bug 931792 - only init sCanaryOutputFD once r=bsmedberg 2013-10-29 16:58:09 -04:00
Joshua Cranmer 1a6dffc73f Bug 884061 - Part 3y: Use NS_DECL_THREADSAFE_ISUPPORTS in xpcom/, r=bsmedberg
--HG--
extra : rebase_source : d54f6973e3ff859207115013e8361781769ffc76
2013-07-18 21:31:26 -05:00
Nicolas B. Pierron 5cb1226f59 Bug 876029 - Make Gonk memory pressure by-pass the event queue. r=jlebar 2013-07-09 13:47:15 -07:00
Ryan VanderMeulen 4e41e3d6e7 Backed out changeset 1c6223f7c74f (bug 876029) for Android armv6 mochitest-1/3 crahes. 2013-07-07 21:18:36 -04:00
Nicolas B. Pierron 912277b213 Bug 876029 - Make Gonk memory pressure by-pass the event queue. r=jlebar 2013-07-07 16:02:58 -07:00
Olli Pettay c370341643 Bug 780770, nsThread::SetMainThreadObserver, r=bz+bholley 2012-10-24 01:26:36 +03:00
Ehsan Akhgari e368dc9c85 Bug 579517 - Part 1: Automated conversion of NSPR numeric types to stdint types in Gecko; r=bsmedberg
This patch was generated by a script.  Here's the source of the script for
future reference:

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name nsXPCOMCID.h \
       ! -name prtypes.h \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert PRInt8 int8_t
convert PRUint8 uint8_t
convert PRInt16 int16_t
convert PRUint16 uint16_t
convert PRInt32 int32_t
convert PRUint32 uint32_t
convert PRInt64 int64_t
convert PRUint64 uint64_t

convert PRIntn int
convert PRUintn unsigned

convert PRSize size_t

convert PROffset32 int32_t
convert PROffset64 int64_t

convert PRPtrdiff ptrdiff_t

convert PRFloat64 double
2012-08-22 11:56:38 -04:00
Aryeh Gregor d0ad5a7d0c Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00
Ehsan Akhgari a65931aaf4 Bug 772518 - Remove nsThread::mShutdownPending because it is unused; r=bsmedberg 2012-07-10 16:12:41 -04:00
Ehsan Akhgari df3797a6e7 Bug 758992 - Make the classes which use the XPCOM nsISupports implementation macros final, to avoid the warning about deleting using a pointer to a base class with virtual functions and no virtual dtor (XPCOM parts); r=bsmedberg 2012-06-05 19:51:58 -04:00
Gervase Markham 82ff7027aa Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
Benjamin Smedberg d14fc6c435 Bug 719154, remove the implementation of chained and filtered event queues now that they are no longer needed, r=jlebar
--HG--
extra : rebase_source : 54e3f130dfaf59e67974019e39bf85471b22b4bf
2012-03-23 14:45:41 -04:00
Bobby Holley afe65920bd Bug 716167 - Only push null contexts in XPConnect for main thread events, and remove infrastructure from bug 326777. r=bz 2012-01-14 10:31:16 -08:00
Bobby Holley 30d8ae4049 Bug 717498 - Clear nsThread::mEventObservers at thread shutdown. r=bsmedberg 2012-01-14 10:31:13 -08:00
Justin Lebar bb1480e722 Bug 670967 - Part 1: Add mozilla::ScheduleMemoryPressureEvent(). r=bsmedberg
--HG--
extra : rebase_source : d1d8b245aa3b86ae434b0b2694d8781f25ad0683
2011-08-05 18:10:50 -04:00
Benjamin Smedberg da0a1b5773 Bug 429592 - Add a monitor thread for process hangs and crash by default if a chrome process doesn't end up back in the event loop for more than 30 seconds. By default this affects non-debug builds only. r=cjones/bent
--HG--
extra : rebase_source : 338bad7e999d5a3c928a7b24965461fc0ff06a19
2011-10-12 13:52:26 -04:00
Michael Wu d2b70213ac Bug 675553 - Switch from PRBool to bool on a CLOSED TREE , r=bsmedberg,khuey,bz,cjones
--HG--
rename : tools/trace-malloc/bloatblame.c => tools/trace-malloc/bloatblame.cpp
2011-09-28 23:19:26 -07:00
Chris Pearce 9fe588f07c Bug 664341 - Provide API to specify thread stack size. r=bsmedberg 2011-07-27 15:26:47 +12:00
Ben Turner 257389646e Bug 665579: Merge nsIThreadInternal and nsIThreadInternal2. r=bsmedberg 2011-06-24 14:12:54 -07:00
Chris Jones ext:(%20and%20Kyle%20Huey%20%3Ckhuey%40kylehuey.com%3E) 2c92e3ecd5 Rollup of bug 645263 and bug 646259: Switch to mozilla:: sync primitives. r=cjones,dbaron,doublec,ehsan src=bsmedberg
Bug 645263, part 0: Count sync primitive ctor/dtors. r=dbaron
Bug 645263, part 1: Migrate content/media to mozilla:: sync primitives. r=doublec
Bug 645263, part 2: Migrate modules/plugin to mozilla:: sync primitives. sr=bsmedberg
Bug 645263, part 3: Migrate nsComponentManagerImpl to mozilla:: sync primitives. sr=bsmedberg
Bug 645263, part 4: Migrate everything else to mozilla:: sync primitives. r=dbaron
Bug 645263, part 5: Remove nsAutoLock.*. sr=bsmedberg
Bug 645263, part 6: Make editor test be nicer to deadlock detector. r=ehsan
Bug 645263, part 7: Disable tracemalloc backtraces for xpcshell tests. r=dbaron
Bug 646259: Fix nsCacheService to use a CondVar for notifying. r=cjones
2011-03-31 23:29:02 -05:00
Chris Jones 699024f868 Backed out changeset 4beec31b9ea9 for increasing frequency of intermittent orange bug 618052 2011-03-31 18:57:38 -05:00
Chris Jones ext:(%20and%20Kyle%20Huey%20%3Ckhuey%40kylehuey.com%3E) 0ce53bb598 Rollup of bug 645263 and bug 646259: Switch to mozilla:: sync primitives. r=cjones,dbaron,doublec,ehsan src=bsmedberg
Bug 645263, part 0: Count sync primitive ctor/dtors. r=dbaron
Bug 645263, part 1: Migrate content/media to mozilla:: sync primitives. r=doublec
Bug 645263, part 2: Migrate modules/plugin to mozilla:: sync primitives. sr=bsmedberg
Bug 645263, part 3: Migrate nsComponentManagerImpl to mozilla:: sync primitives. sr=bsmedberg
Bug 645263, part 4: Migrate everything else to mozilla:: sync primitives. r=dbaron
Bug 645263, part 5: Remove nsAutoLock.*. sr=bsmedberg
Bug 645263, part 6: Make editor test be nicer to deadlock detector. r=ehsan
Bug 645263, part 7: Disable tracemalloc backtraces for xpcshell tests. r=dbaron
Bug 646259: Fix nsCacheService to use a CondVar for notifying. r=cjones
2011-03-31 14:51:19 -05:00
Ben Turner 72ea70e7b6 Bug 612807 - 'IndexedDB: Transaction thread observer isn't quite safe'. r=jst, a=blocking+. 2010-11-18 14:19:19 -08:00
Benjamin Smedberg ec247769d5 Bug 610381 part A - Propagate errors thrown during synchronous dispatch of nsIRunnables, r=bz
--HG--
extra : rebase_source : e445ee4db34c68fd9f9c8844f62d879708733eff
2010-11-17 15:58:48 -05:00
Ben Turner 488481b966 Bug 608186 - 'IndexedDB: Transactions should expire when we return to the event loop'. r=sicking, a=blocking+ 2010-11-15 13:49:49 -08:00
Arpad Borsos c72ef7d248 Bug 456388 - Remove PR_STATIC_CALLBACK and PR_CALLBACK(_DECL) from the tree; r+sr=brendan 2008-10-10 17:04:34 +02:00
roc+@cs.cmu.edu 16fb24b0d4 Bug 404870. Don't allow nsThread::PutEvent to succeed when the thread is no longer able to process the event. This stops us leaking the event and anything hanging off it. r+sr=bsmedberg 2007-12-04 18:17:15 -08:00
bzbarsky@mit.edu 3b90c5c518 Relanding bug 326777, r=bsmedberg, sr=jst 2007-07-10 17:57:17 -07:00
bzbarsky@mit.edu b35a654a6e Backing out to fix red 2007-07-09 21:07:45 -07:00
bzbarsky@mit.edu 30e205dddb Make sure that we push a null JSContext on the current thread's XPConnect stack
before processing events.  Bug 326777, r=bsmedberg, sr=jst
2007-07-09 20:48:06 -07:00
darin%meer.net 0318b8c707 landing patch for bug 326273 "Implement nsIThreadManager" (Mac portions by Mark Mentovai) with reviews from bienvenu, bsmedberg, bzbarsky, josh, roc, and ssieb 2006-05-10 17:30:15 +00:00
gerv%gerv.net 31625ba2b1 Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 14:21:17 +00:00
bryner%brianryner.com 0c7c3a2ff3 Bug 229875 - eliminate unnecssary public/virtual destructors. This patch changes all refcounted classes under xpcom/, which aren't inherited from or used on the stack, to have private, nonvirtual destructors. r=dougt, sr=dbaron. 2004-01-15 06:14:18 +00:00
darin%meer.net 77642ae698 fixes bug 210125 "need to be able to AsyncWait for closure only" r=dougt sr=bzbarsky 2003-10-06 01:46:31 +00:00
dougt%netscape.com bffa9d4af1 175932. UMR: PostTimerEvent() does not check return value from GetPRThread(). Thanks to Andrew Schultz for pointing this out. r=pavlov, sr=darin. Also includes 175440 - using nsCOMArray in nsThreadPool, patch by bzbarsky@mit.edu 2002-11-08 04:46:58 +00:00
dougt%netscape.com ea1c9a9cab Fixes bug 84489. Ensures that worker threads can not process the same reque
st at the same time. r-danm@netscape.com, sr-darin@netscape.com, a-clayton@n
etscape.com
2001-06-12 18:35:23 +00:00
jband%netscape.com fe62695f13 fix bug 61369. Race between nsThread Init and Main. Also additions to make the interface more useful to non-C++ code. r=brendan sr=waterson 2000-11-30 05:24:53 +00:00
danm%netscape.com 06a281a74b ignore busy threads when determining whether to add a new thread to the pool. bugs 55032,56337,58404,60338, others. r=beard,brendan,dougt,saari 2000-11-28 22:38:02 +00:00
dougt%netscape.com 25f36f554d Fixes threadpool to maximize thread usage r=wtc@netscape.com, warren@netscape.com, brendan@mozilla.org, a=brendan@mozilla.org b=36750 2000-10-01 05:35:03 +00:00
mkaply%us.ibm.com 152f6f29e4 # 34082
r= dougt@netscape.com
OS/2 bring up continues - Adding PR_CALLBACKs for VisualAge Compiler
2000-05-02 22:38:04 +00:00
warren%netscape.com 5e96caa8ea Fixed thread pool thread allocation to be more lazy (still doesn't release unused threads though). (Code adapted from dougt.) 2000-04-21 05:12:57 +00:00
pavlov%netscape.com bfd20afd4c backing out dougt's thread changes r=dougt 2000-03-06 01:13:20 +00:00
warren%netscape.com c0497e31be Bug 21556: Making linux be thread-safe. Making tons of classes implement threadsafe AddRef/Release. a=jar 2000-03-05 21:26:01 +00:00
dougt%netscape.com c673d88d87 Adding dynamic thread allocation to thread pool. Fixes 27736.
Also fixing warning in plevent.c

r=damn, a=chofmann
2000-03-05 21:01:33 +00:00
dmose%mozilla.org 142ac52eaf updated xPL license boilerplate to v1.1, a=chofmann@netscape.com,r=endico@mozilla.org 1999-11-06 03:43:54 +00:00
valeski%netscape.com d66cd6ac49 15300 r=warren. Changed NS_NewThread api to default to PR_UNJOINABLE_THREAD, also added new NS_NewThread() function so you don't have to combine the runnable w/ thread creation. added threads to xpcom init so you can create them w/ the com mgr. 1999-10-01 23:30:06 +00:00
warren%netscape.com 0f38c8859b Taking out the damn nsCOMPtr for nsThreadPool for Mac! 1999-09-20 22:35:06 +00:00