example/heartbeat: Demonstrate a floating source
This adds a trivial example of a floating source.
Change-Id: Iefc30e69ee306f431eb0f2a68bf8906f23218636
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/example/heartbeat.cpp b/example/heartbeat.cpp
index f7390d7..4a1374a 100644
--- a/example/heartbeat.cpp
+++ b/example/heartbeat.cpp
@@ -46,6 +46,6 @@
Time time(event, Clock(event).now(), std::chrono::seconds{1},
std::move(hbFunc));
stdplus::signal::block(SIGINT);
- Signal signal(event, SIGINT, intCb);
+ Signal(event, SIGINT, intCb).set_floating(true);
return event.loop();
}
diff --git a/example/heartbeat_timer.cpp b/example/heartbeat_timer.cpp
index f71af3c..d9203ac 100644
--- a/example/heartbeat_timer.cpp
+++ b/example/heartbeat_timer.cpp
@@ -43,6 +43,6 @@
event, [](Timer&) { printf("Beat\n"); },
std::chrono::seconds{interval});
stdplus::signal::block(SIGINT);
- Signal signal(event, SIGINT, intCb);
+ Signal(event, SIGINT, intCb).set_floating(true);
return event.loop();
}