`cleanup`: specify that it's safe to use the class in a signal handler. The class is intentionally designed for exactly what is needed here: no type erasure, and therefore allocations and no locks taken. It's also not conceivable that we would ever change this without introducing a new API, as doing so would serve no purpose and harm performance. PiperOrigin-RevId: 852955861 Change-Id: I67bb75cf17c1184392bbec6ed9d15faee2f6376b
diff --git a/absl/cleanup/cleanup.h b/absl/cleanup/cleanup.h index 311e482..632ec6e 100644 --- a/absl/cleanup/cleanup.h +++ b/absl/cleanup/cleanup.h
@@ -19,6 +19,10 @@ // `absl::Cleanup` implements the scope guard idiom, invoking the contained // callback's `operator()() &&` on scope exit. // +// This class doesn't allocate or take any locks, and is safe to use in a signal +// handler. Of course the callback with which it is constructed also must be +// signal safe in order for this to be useful. +// // Example: // // ```