diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-04-12 00:01:27 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-04-12 00:01:27 -0400 |
commit | 24de3887e5e3bba2b8a4f60d1224ac927b98b1ed (patch) | |
tree | 20a27018a7fae78205e0bfee7fac4db4c82c0dea /src/wg.h | |
parent | c8f6735fce3d7ba5aa8019775d26b6999ed5a344 (diff) |
stuff
- fix memory leaks (except for those from libusb)
- fix graceful shutdown
- fix systemd weirdness
Diffstat (limited to 'src/wg.h')
-rw-r--r-- | src/wg.h | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -21,18 +21,17 @@ #include <pthread.h> -/* Thread management tools modeled on https://golang.org/pkg/sync/#WaitGroup */ - -/* pthread_cond_t is overly complicated. Just use a self-pipe. */ +/* When you call wg_wait, the waitgroup is destroyed. You must + * re-wg_init it if you want to reuse it. */ struct wg { int count; pthread_mutex_t lock; - int fd_wait; - int fd_signal; + int fd_threads[2]; + pthread_t gc; }; void wg_init(struct wg *); -void wg_add(struct wg *, unsigned int); -void wg_sub(struct wg *, unsigned int); +void wg_add(struct wg *); +void wg_sub(struct wg *); void wg_wait(struct wg*); |