aboutsummaryrefslogtreecommitdiff
path: root/src/pth.c
diff options
context:
space:
mode:
authorDavid Timber <mieabby@gmail.com>2020-09-20 00:55:13 +0930
committerDavid Timber <mieabby@gmail.com>2020-09-20 00:55:13 +0930
commit48861d2128f7028d25c1d03b0cfd9dc5d56b0f66 (patch)
tree51b417d2cc7c07b50e259dd25d8f877303a832c8 /src/pth.c
parent66a17c4bf5c38579e460209c2028d3275f366121 (diff)
* Impl bne
* Add prne_pth_reset_timer(), prne_build_str()
Diffstat (limited to 'src/pth.c')
-rw-r--r--src/pth.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/pth.c b/src/pth.c
index 2294c90..7186a53 100644
--- a/src/pth.c
+++ b/src/pth.c
@@ -78,3 +78,13 @@ void prne_pth_cv_notify (pth_mutex_t *lock, pth_cond_t *cond, bool broadcast) {
pth_time_t prne_pth_tstimeout (const struct timespec ts) {
return pth_timeout(ts.tv_sec, ts.tv_nsec / 1000);
}
+
+void prne_pth_reset_timer (pth_event_t *ev, const struct timespec *ts) {
+ pth_event_free(*ev, FALSE);
+ if (ts != NULL) {
+ *ev = pth_event(
+ PTH_EVENT_TIME,
+ prne_pth_tstimeout(*ts));
+ prne_assert(*ev != NULL);
+ }
+}