From 03deac86d4448e0422fefefea0018d6f5bea1a8d Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 2 Aug 2014 22:24:14 +0200 Subject: mds-registry: add time-to-live MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-registry/slave.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/mds-registry/slave.h') diff --git a/src/mds-registry/slave.h b/src/mds-registry/slave.h index cd98f80..9f08f07 100644 --- a/src/mds-registry/slave.h +++ b/src/mds-registry/slave.h @@ -24,6 +24,7 @@ #include #include #include +#include @@ -32,7 +33,7 @@ /** * Slave information, a thread waiting for protocols to become available */ -typedef struct slave /* TODO: add time-to-live */ +typedef struct slave { /** * Set of protocols for which to wait that they become available @@ -69,6 +70,17 @@ typedef struct slave /* TODO: add time-to-live */ */ pthread_t thread; + /** + * The time slave should die if its condition + * has not be meet at that time + */ + struct timespec dethklok; + + /** + * Whether `dethklok` should apply + */ + int timed; + } slave_t; -- cgit v1.2.3-70-g09d2