aboutsummaryrefslogtreecommitdiff
path: root/src/core/defs.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2016-12-22 15:23:21 -0800
committerGarrett D'Amore <garrett@damore.org>2016-12-22 15:23:21 -0800
commit934c1316ae47754a2e368c65228c3cbfe552680f (patch)
treee81c4d2854df83e3d908c9269dd35c0600fa6acb /src/core/defs.h
parentee969ad99dc1e07e1c38876223e7aed13463b121 (diff)
downloadnng-934c1316ae47754a2e368c65228c3cbfe552680f.tar.gz
nng-934c1316ae47754a2e368c65228c3cbfe552680f.tar.bz2
nng-934c1316ae47754a2e368c65228c3cbfe552680f.zip
Inline locks (fewer allocs), simpler absolute times for wakeups. nn_sock_recv.
Diffstat (limited to 'src/core/defs.h')
-rw-r--r--src/core/defs.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/defs.h b/src/core/defs.h
index b294e0f3..a37377f7 100644
--- a/src/core/defs.h
+++ b/src/core/defs.h
@@ -10,6 +10,8 @@
#ifndef CORE_DEFS_H
#define CORE_DEFS_H
+#include <stdint.h>
+
// C compilers may get unhappy when named arguments are not used. While
// there are things like __attribute__((unused)) which are arguably
// superior, support for such are not universal.
@@ -32,4 +34,12 @@ typedef struct nni_pipe_ops nni_pipe_ops;
typedef struct nni_protocol nni_protocol;
+typedef int nni_signal; // Used as a turnstile/wakeup channel.
+typedef uint64_t nni_time; // An absolute time in microseconds.
+typedef int nni_duration; // A relative time in microseconds.
+
+// Some default timing things.
+#define NNI_TIME_NEVER ((nni_time) 0xffffffffull)
+#define NNI_TIME_ZERO ((nni_time) 0)
+
#endif // CORE_DEFS_H