зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central and b2g-inbound
This commit is contained in:
Коммит
a82632349d
|
@ -19,7 +19,7 @@
|
|||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="e93780f9da8b34f370a4113abd4df9780d58e443"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="95e2225a14bf8ac1ff5046923bf69b64015fa4cd"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2249037c79fda1d2eede2d085716577d5357e796"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="e93780f9da8b34f370a4113abd4df9780d58e443"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="95e2225a14bf8ac1ff5046923bf69b64015fa4cd"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2249037c79fda1d2eede2d085716577d5357e796"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="71f5a35e3bc1801847413cff1f14fc3b5cd991ca"/>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<project name="platform_build" path="build" remote="b2g" revision="999e945b85c578c503ad445c2285940f16aacdae">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="e93780f9da8b34f370a4113abd4df9780d58e443"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="95e2225a14bf8ac1ff5046923bf69b64015fa4cd"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2249037c79fda1d2eede2d085716577d5357e796"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="e93780f9da8b34f370a4113abd4df9780d58e443"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="95e2225a14bf8ac1ff5046923bf69b64015fa4cd"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2249037c79fda1d2eede2d085716577d5357e796"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
</project>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="e93780f9da8b34f370a4113abd4df9780d58e443"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="95e2225a14bf8ac1ff5046923bf69b64015fa4cd"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2249037c79fda1d2eede2d085716577d5357e796"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="71f5a35e3bc1801847413cff1f14fc3b5cd991ca"/>
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
"remote": "",
|
||||
"branch": ""
|
||||
},
|
||||
"revision": "f47342e0a4e802b69ec1da8b641f24ae35016d9d",
|
||||
"revision": "04e4f52e1d5b6f75100cdd99fa7a58ab36834938",
|
||||
"repo_path": "/integration/gaia-central"
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="e93780f9da8b34f370a4113abd4df9780d58e443"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="95e2225a14bf8ac1ff5046923bf69b64015fa4cd"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2249037c79fda1d2eede2d085716577d5357e796"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="e93780f9da8b34f370a4113abd4df9780d58e443"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="95e2225a14bf8ac1ff5046923bf69b64015fa4cd"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2249037c79fda1d2eede2d085716577d5357e796"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="e93780f9da8b34f370a4113abd4df9780d58e443"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="95e2225a14bf8ac1ff5046923bf69b64015fa4cd"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2249037c79fda1d2eede2d085716577d5357e796"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="71f5a35e3bc1801847413cff1f14fc3b5cd991ca"/>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="e93780f9da8b34f370a4113abd4df9780d58e443"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="95e2225a14bf8ac1ff5046923bf69b64015fa4cd"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2249037c79fda1d2eede2d085716577d5357e796"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
|
|
@ -222,7 +222,11 @@ public:
|
|||
protected:
|
||||
// Main thread access only.
|
||||
// These are called on the main thread by Listener.
|
||||
NS_DECL_NSISTREAMINGPROTOCOLLISTENER
|
||||
nsresult OnMediaDataAvailable(uint8_t aIndex, const nsACString& aData,
|
||||
uint32_t aLength, uint32_t aOffset,
|
||||
nsIStreamingProtocolMetaData* aMeta);
|
||||
nsresult OnConnected(uint8_t aIndex, nsIStreamingProtocolMetaData* aMeta);
|
||||
nsresult OnDisconnected(uint8_t aIndex, nsresult aReason);
|
||||
|
||||
nsRefPtr<Listener> mListener;
|
||||
|
||||
|
|
|
@ -140,7 +140,21 @@ struct thread_info : public mozilla::LinkedListElement<thread_info> {
|
|||
|
||||
TLSInfoList tlsInfo;
|
||||
|
||||
pthread_mutex_t *reacquireMutex;
|
||||
/**
|
||||
* We must ensure that the recreated thread has entered pthread_cond_wait() or
|
||||
* similar functions before proceeding to recreate the next one. Otherwise, if
|
||||
* the next thread depends on the same mutex, it may be used in an incorrect
|
||||
* state. To do this, the main thread must unconditionally acquire the mutex.
|
||||
* The mutex is unconditionally released when the recreated thread enters
|
||||
* pthread_cond_wait(). The recreated thread may have locked the mutex itself
|
||||
* (if the pthread_mutex_trylock succeeded) or another thread may have already
|
||||
* held the lock. If the recreated thread did lock the mutex we must balance
|
||||
* that with another unlock on the main thread, which is signaled by
|
||||
* condMutexNeedsBalancing.
|
||||
*/
|
||||
pthread_mutex_t *condMutex;
|
||||
bool condMutexNeedsBalancing;
|
||||
|
||||
void *stk;
|
||||
|
||||
pid_t origNativeThreadID;
|
||||
|
@ -501,7 +515,8 @@ thread_info_new(void) {
|
|||
tinfo->recrArg = nullptr;
|
||||
tinfo->recreatedThreadID = 0;
|
||||
tinfo->recreatedNativeThreadID = 0;
|
||||
tinfo->reacquireMutex = nullptr;
|
||||
tinfo->condMutex = nullptr;
|
||||
tinfo->condMutexNeedsBalancing = false;
|
||||
tinfo->stk = MozTaggedAnonymousMmap(nullptr,
|
||||
NUWA_STACK_SIZE + getPageSize(),
|
||||
PROT_READ | PROT_WRITE,
|
||||
|
@ -1016,19 +1031,32 @@ __wrap_pthread_cond_wait(pthread_cond_t *cond,
|
|||
return rv;
|
||||
}
|
||||
if (recreated && mtx) {
|
||||
if (!freezePoint1 && pthread_mutex_trylock(mtx)) {
|
||||
if (!freezePoint1) {
|
||||
tinfo->condMutex = mtx;
|
||||
// The thread was frozen in pthread_cond_wait() after releasing mtx in the
|
||||
// Nuwa process. In recreating this thread, We failed to reacquire mtx
|
||||
// with the pthread_mutex_trylock() call, that is, mtx was acquired by
|
||||
// another thread. Because of this, we need the main thread's help to
|
||||
// reacquire mtx so that it will be in a valid state.
|
||||
tinfo->reacquireMutex = mtx;
|
||||
if (!pthread_mutex_trylock(mtx)) {
|
||||
tinfo->condMutexNeedsBalancing = true;
|
||||
}
|
||||
}
|
||||
RECREATE_CONTINUE();
|
||||
RECREATE_PASS_VIP();
|
||||
}
|
||||
rv = REAL(pthread_cond_wait)(cond, mtx);
|
||||
if (recreated && mtx) {
|
||||
// We have reacquired mtx. The main thread also wants to acquire mtx to
|
||||
// synchronize with us. If the main thread didn't get a chance to acquire
|
||||
// mtx let it do that now. The main thread clears condMutex after acquiring
|
||||
// it to signal us.
|
||||
if (tinfo->condMutex) {
|
||||
// We need mtx to end up locked, so tell the main thread not to unlock
|
||||
// mtx after it locks it.
|
||||
tinfo->condMutexNeedsBalancing = false;
|
||||
pthread_mutex_unlock(mtx);
|
||||
}
|
||||
// We still need to be gated as not to acquire another mutex associated with
|
||||
// another VIP thread and interfere with it.
|
||||
RECREATE_GATE_VIP();
|
||||
|
@ -1052,14 +1080,21 @@ __wrap_pthread_cond_timedwait(pthread_cond_t *cond,
|
|||
return rv;
|
||||
}
|
||||
if (recreated && mtx) {
|
||||
if (!freezePoint1 && pthread_mutex_trylock(mtx)) {
|
||||
tinfo->reacquireMutex = mtx;
|
||||
if (!freezePoint1) {
|
||||
tinfo->condMutex = mtx;
|
||||
if (!pthread_mutex_trylock(mtx)) {
|
||||
tinfo->condMutexNeedsBalancing = true;
|
||||
}
|
||||
}
|
||||
RECREATE_CONTINUE();
|
||||
RECREATE_PASS_VIP();
|
||||
}
|
||||
rv = REAL(pthread_cond_timedwait)(cond, mtx, abstime);
|
||||
if (recreated && mtx) {
|
||||
if (tinfo->condMutex) {
|
||||
tinfo->condMutexNeedsBalancing = false;
|
||||
pthread_mutex_unlock(mtx);
|
||||
}
|
||||
RECREATE_GATE_VIP();
|
||||
}
|
||||
THREAD_FREEZE_POINT2_VIP();
|
||||
|
@ -1087,14 +1122,21 @@ __wrap___pthread_cond_timedwait(pthread_cond_t *cond,
|
|||
return rv;
|
||||
}
|
||||
if (recreated && mtx) {
|
||||
if (!freezePoint1 && pthread_mutex_trylock(mtx)) {
|
||||
tinfo->reacquireMutex = mtx;
|
||||
if (!freezePoint1) {
|
||||
tinfo->condMutex = mtx;
|
||||
if (!pthread_mutex_trylock(mtx)) {
|
||||
tinfo->condMutexNeedsBalancing = true;
|
||||
}
|
||||
}
|
||||
RECREATE_CONTINUE();
|
||||
RECREATE_PASS_VIP();
|
||||
}
|
||||
rv = REAL(__pthread_cond_timedwait)(cond, mtx, abstime, clock);
|
||||
if (recreated && mtx) {
|
||||
if (tinfo->condMutex) {
|
||||
tinfo->condMutexNeedsBalancing = false;
|
||||
pthread_mutex_unlock(mtx);
|
||||
}
|
||||
RECREATE_GATE_VIP();
|
||||
}
|
||||
THREAD_FREEZE_POINT2_VIP();
|
||||
|
@ -1403,8 +1445,17 @@ RecreateThreads() {
|
|||
RECREATE_BEFORE(tinfo);
|
||||
thread_recreate(tinfo);
|
||||
RECREATE_WAIT();
|
||||
if (tinfo->reacquireMutex) {
|
||||
REAL(pthread_mutex_lock)(tinfo->reacquireMutex);
|
||||
if (tinfo->condMutex) {
|
||||
// Synchronize with the recreated thread in pthread_cond_wait().
|
||||
REAL(pthread_mutex_lock)(tinfo->condMutex);
|
||||
// Tell the other thread that we have successfully locked the mutex.
|
||||
// NB: condMutex can only be touched while it is held, so we must clear
|
||||
// it here and store the mutex locally.
|
||||
pthread_mutex_t *mtx = tinfo->condMutex;
|
||||
tinfo->condMutex = nullptr;
|
||||
if (tinfo->condMutexNeedsBalancing) {
|
||||
pthread_mutex_unlock(mtx);
|
||||
}
|
||||
}
|
||||
} else if(!(tinfo->flags & TINFO_FLAG_NUWA_SKIP)) {
|
||||
// An unmarked thread is found other than the main thread.
|
||||
|
|
Загрузка…
Ссылка в новой задаче