about summary refs log tree commit homepage
path: root/selfwake.h
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-12-02 04:28:54 +0000
committerEric Wong <normalperson@yhbt.net>2013-12-02 04:34:23 +0000
commit1a4a94f338dbe641a3f1b27a080fc34bac7f43d4 (patch)
treeff3693dccaaba9030c6cd3768328bca8144be78a /selfwake.h
parentb7bda87ead4a53bb792dbbfb6079aad8cd4170de (diff)
downloadcmogstored-1a4a94f338dbe641a3f1b27a080fc34bac7f43d4.tar.gz
This only affects users of the undocumented --worker-processes
switch.  Furthermore, this only affects non-Linux platforms which
rely on the pipe implementation of selfwake.

This prevents us from wasting one extraneous file descriptor slot
(and hence potentially wasting 128 bytes in userland).
Diffstat (limited to 'selfwake.h')
-rw-r--r--selfwake.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/selfwake.h b/selfwake.h
index 37bf0f6..15c0ac0 100644
--- a/selfwake.h
+++ b/selfwake.h
@@ -23,6 +23,7 @@ struct mog_selfpipe {
 struct mog_fd * mog_selfwake_new(void);
 void mog_selfwake_trigger(struct mog_fd *);
 void mog_selfwake_drain(struct mog_fd *);
+#define mog_selfwake_put(mfd) mog_fd_put((mfd))
 static inline void mog_selfwake_interrupt(void) {}
 void mog_selfwake_wait(struct mog_fd *);
 #else /* use Linux-only facilities like epoll_pwait or ppoll */
@@ -33,6 +34,7 @@ static inline void mog_selfwake_wait(struct mog_fd *mfd)
 static inline struct mog_fd * mog_selfwake_new(void) { return NULL; }
 static inline void mog_selfwake_trigger(struct mog_fd *mfd) {}
 static inline void mog_selfwake_drain(struct mog_fd *mfd) {}
+static inline void mog_selfwake_put(struct mog_fd *mfd) {}
 static inline void mog_selfwake_interrupt(void)
 {
         CHECK(int, 0, kill(getpid(), SIGURG));