diff options
author | David Timber <mieabby@gmail.com> | 2020-09-20 00:55:13 +0930 |
---|---|---|
committer | David Timber <mieabby@gmail.com> | 2020-09-20 00:55:13 +0930 |
commit | 48861d2128f7028d25c1d03b0cfd9dc5d56b0f66 (patch) | |
tree | 51b417d2cc7c07b50e259dd25d8f877303a832c8 /src/pth.c | |
parent | 66a17c4bf5c38579e460209c2028d3275f366121 (diff) |
* Impl bne
* Add prne_pth_reset_timer(), prne_build_str()
Diffstat (limited to 'src/pth.c')
-rw-r--r-- | src/pth.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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); + } +} |