Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: took out read vol. sig_atomic_t from intro; it is in exception

Accessing or modifying shared objects in signal handlers can result in race conditions that can leave data in an inconsistent state. The exception to this rule is the ability to read and write to lock-free atomic objects or write to variables of volatile sig_atomic_t. The need for the volatile keyword is described in DCL22-C. Use volatile for data that cannot be cached. It is important to note that the behavior of a program that accesses an object of any other type from a signal handler, including reading from a volatile sig_atomic_t is handler is undefined. (See undefined behavior 131 in Appendix J of the C Standard.)

...