aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds-registry/slave.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-08-02 22:24:14 +0200
committerMattias Andrée <maandree@operamail.com>2014-08-02 22:24:20 +0200
commit03deac86d4448e0422fefefea0018d6f5bea1a8d (patch)
tree3fbc9995599b241ad13b91d84e591d1f428f9f01 /src/mds-registry/slave.h
parentmds-registry use timedwait in slaves so we can stop when reexecing of terminating (diff)
downloadmds-03deac86d4448e0422fefefea0018d6f5bea1a8d.tar.gz
mds-03deac86d4448e0422fefefea0018d6f5bea1a8d.tar.bz2
mds-03deac86d4448e0422fefefea0018d6f5bea1a8d.tar.xz
mds-registry: add time-to-live
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/mds-registry/slave.h')
-rw-r--r--src/mds-registry/slave.h14
1 files changed, 13 insertions, 1 deletions
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 <stdlib.h>
#include <stdint.h>
#include <pthread.h>
+#include <time.h>
@@ -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;