std::sig_atomic_t(3)
π NAME π
Bestie, welcome to std::sig_atomic_t(3) from the C++ Standard Libary β and the NAME line is literally std::sig_atomic_t - std::sig_atomic_t, which is the most βI contain multitudesβ thing ever. π
β¨ Synopsis β¨
First things first: itβs Defined in header <csignal>, so thatβs where you go looking. π
typedef /* unspecified */ sig_atomic_t;
Okay so what is it? Itβs an integer type that can be accessed as an atomic entity even in the presence of asynchronous interrupts made by signals. Thatβs the whole assignment, fr. π₯
π Notes π
History lesson, but make it cute: until C++11, which introduced std::atomic and std::atomic_signal_fence, about the only thing a strictly conforming program could do in a signal handler was assign a value to a volatile static std::sig_atomic_t variable and promptly return. Thatβs it. Thatβs the move. No extra side quests. π
π¦ See also π¦
signalβ sets a signal handler for particular signal (function)atomic_signal_fence(C++11)β fence between a thread and a signal handler executed in the same thread (function)- C documentation for
sig_atomic_t
Thatβs the whole page, bestie π«Ά source: http://cppreference.com Β· version/date: 2024.06.10 Β· mwah π
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms