// we cannot rely on sigsetjmp/siglongjmp to save/restore the signal mask // since on at least some systems (OS X) siglongjmp will restore the mask // for the process, not the thread
pthread_sigmask(0, NULL, &saved_sig_mask); if (sigsetjmp(_jmpbuf, 0) == 0) { // make sure we can see in the signal handler that we have crash protection // installed
_crash_protection = this;
cb.call(); // and clear the crash protection
_crash_protection = NULL;
_protected_thread = NULL; returntrue;
} // this happens when we siglongjmp() back
pthread_sigmask(SIG_SETMASK, &saved_sig_mask, NULL);
_crash_protection = NULL;
_protected_thread = NULL; returnfalse;
}
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 und die Messung sind noch experimentell.