summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@ugent.be>2017-09-24 14:34:03 +0200
committerdimitri staessens <dimitri.staessens@ugent.be>2017-09-24 14:34:03 +0200
commitff5063ad0e7902ce59864a466bd9d8d606d788e4 (patch)
tree17f66b04659a06c018494eb732adb661111d63f2 /include
parent7cef269be64f64b920763c6f2455931422c8bfe9 (diff)
downloadouroboros-ff5063ad0e7902ce59864a466bd9d8d606d788e4.tar.gz
ouroboros-ff5063ad0e7902ce59864a466bd9d8d606d788e4.zip
ipcpd: Add threadpool manager to DHT
This adds a threadpool manager to the DHT. This was needed because the detached thread could cause a data race on shutdown. The threadpool manager is revised to allow multiple instances in a single program. The irmd and ipcp now store commands in a buffer (list) instead of a single buffer before passing it to handler threads.
Diffstat (limited to 'include')
-rw-r--r--include/ouroboros/tpm.h23
1 files changed, 13 insertions, 10 deletions
diff --git a/include/ouroboros/tpm.h b/include/ouroboros/tpm.h
index dc57f485..74e45035 100644
--- a/include/ouroboros/tpm.h
+++ b/include/ouroboros/tpm.h
@@ -25,22 +25,25 @@
#include <stdbool.h>
-int tpm_init(size_t min,
- size_t inc,
- void * (* func)(void *));
+struct tpm;
-int tpm_start(void);
+struct tpm * tpm_create(size_t min,
+ size_t inc,
+ void * (* func)(void *),
+ void * o);
-void tpm_stop(void);
+void tpm_destroy(struct tpm * tpm);
-void tpm_fini(void);
+int tpm_start(struct tpm * tpm);
-bool tpm_check(void);
+void tpm_stop(struct tpm * tpm);
-void tpm_exit(void);
+bool tpm_check(struct tpm * tpm);
-void tpm_dec(void);
+void tpm_exit(struct tpm * tpm);
-void tpm_inc(void);
+void tpm_dec(struct tpm * tpm);
+
+void tpm_inc(struct tpm * tpm);
#endif /* OUROBOROS_LIB_TPM_H */