diff --git a/demo/msg_que/main.cpp b/demo/msg_que/main.cpp index 2c19e76..654b4ff 100644 --- a/demo/msg_que/main.cpp +++ b/demo/msg_que/main.cpp @@ -111,10 +111,13 @@ void do_recv() { int main(int argc, char ** argv) { if (argc < 2) return 0; - ::signal(SIGINT, [](int) { + auto exit = [](int) { is_quit__.store(true, std::memory_order_release); que__.disconnect(); - }); + }; + ::signal(SIGINT , exit); + ::signal(SIGBREAK, exit); + ::signal(SIGTERM , exit); if (std::string{ argv[1] } == mode_s__) { do_send(); diff --git a/include/libipc/def.h b/include/libipc/def.h index 9732acf..d9cfdc0 100755 --- a/include/libipc/def.h +++ b/include/libipc/def.h @@ -48,4 +48,17 @@ enum class trans { // transmission template struct wr {}; +template +struct relat_trait; + +template +struct relat_trait> { + constexpr static bool is_multi_producer = (Rp == relat::multi); + constexpr static bool is_multi_consumer = (Rc == relat::multi); + constexpr static bool is_broadcast = (Ts == trans::broadcast); +}; + +template