#ifdefined(HAVE_CONFIG_H) # include "config.h" #endif
#if (defined(__hexagon__) || defined(__native_client__)) \
&& !defined(AO_USE_NO_SIGNALS) && !defined(AO_USE_NANOSLEEP) /* Hexagon QuRT does not have sigprocmask (but Hexagon does not need */ /* emulation, so it is OK not to bother about signals blocking). */ /* Since NaCl is not recognized by configure yet, we do it here. */ # define AO_USE_NO_SIGNALS # define AO_USE_NANOSLEEP #endif
#ifndef AO_NO_PTHREADS # include <pthread.h> #endif
#ifndef AO_USE_NO_SIGNALS # include <signal.h> #endif
#ifdef AO_USE_NANOSLEEP /* This requires _POSIX_TIMERS feature. */ # include <sys/time.h> # include <time.h> #elifdefined(AO_USE_WIN32_PTHREADS) # include <windows.h> /* for Sleep() */ #elifdefined(_HPUX_SOURCE) # include <sys/time.h> #else # include <sys/select.h> #endif
#ifndef AO_HAVE_double_t # include "atomic_ops/sysdeps/standard_ao_double_t.h" #endif
AO_INLINE void block_all_signals(sigset_t *old_sigs_ptr)
{ if (AO_EXPECT_FALSE(!AO_load_acquire(&initialized)))
{
lock(&init_lock); if (!initialized)
sigfillset(&all_sigs);
unlock(&init_lock);
AO_store_release(&initialized, 1);
}
sigprocmask(SIG_BLOCK, &all_sigs, old_sigs_ptr); /* Neither sigprocmask nor pthread_sigmask is 100% */ /* guaranteed to work here. Sigprocmask is not */ /* guaranteed be thread safe, and pthread_sigmask */ /* is not async-signal-safe. Under linuxthreads, */ /* sigprocmask may block some pthreads-internal */ /* signals. So long as we do that for short periods, */ /* we should be OK. */
} #endif/* !AO_USE_NO_SIGNALS */
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.