/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
# ifdefined(LIBC_GLIBC) // On glibc the pthread_atfork may be available only from libc_nonshared.a // so prefer interposing the linker-resolved __register_atfork()
externconstvoid* const __dso_handle; using register_atfork_t = int (*)(void (*)(), void (*)(), void (*)(), constvoid* const); static register_atfork_t real_register_atfork = nullptr; # else using pthread_atfork_t = int (*)(void (*)(), void (*)(), void (*)()); static pthread_atfork_t real_pthread_atfork = nullptr; # endif
int rv = 0; # ifdefined(LIBC_GLIBC) if (real_register_atfork) {
real_register_atfork(aPrefork, aPostForkParent, aPostForkChild, dso_handle); # else if (real_pthread_atfork) {
real_pthread_atfork(aPrefork, aPostForkParent, aPostForkChild); # endif
MOZ_ASSERT(rv == 0, "call to real_register_atfork() failed"); if (rv != 0) { return rv;
}
} else {
++notReadyCount;
}
rv = mozPthreadHandlers.add(aPrefork, aPostForkParent, aPostForkChild # ifdefined(LIBC_GLIBC)
,
dso_handle # else
,
(void*)(1) # endif
)
? 0
: 1;
MOZ_ASSERT(rv == 0, # ifdefined(LIBC_GLIBC) "Should have been able to add to __register_atfork() handlers" # else "Should have been able to add to pthread_atfork() handlers" # endif
);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.