]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
onexit: add an on exit callback utility
authorNoah Watkins <noahwatkins@gmail.com>
Sat, 4 Jan 2014 19:32:51 +0000 (11:32 -0800)
committerNoah Watkins <noahwatkins@gmail.com>
Sat, 4 Jan 2014 20:54:03 +0000 (12:54 -0800)
commit2181d25f7a07803227fc7ad0713ecf19b0507342
tree2250500f86fbc40f8fae9f005eaae3819902e843
parent6663a5eee3cada49c0309263be0b32ef8e5e2adc
onexit: add an on exit callback utility

Adds a class that executes registered callbacks in its destructor. Since
static duration objects have their destructors called when returning
from main or calling exit then this can be used as a replacement for
on_exit.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
src/include/Makefile.am
src/include/on_exit.h [new file with mode: 0644]
src/test/Makefile.am
src/test/on_exit.cc [new file with mode: 0644]