summaryrefslogtreecommitdiff
path: root/src/nng.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-01-26 09:57:56 -0800
committerGarrett D'Amore <garrett@damore.org>2017-01-26 09:57:56 -0800
commitd93cbc059cd1e42773d1aec19f8b49a972f2eac3 (patch)
tree71a6c79e8ae5c2ef9ed9beb06088ccd4d832fca9 /src/nng.h
parenta9e81c87a7b2a203c2bd4f310f936af46ef42fc1 (diff)
downloadnng-d93cbc059cd1e42773d1aec19f8b49a972f2eac3.tar.gz
nng-d93cbc059cd1e42773d1aec19f8b49a972f2eac3.tar.bz2
nng-d93cbc059cd1e42773d1aec19f8b49a972f2eac3.zip
Added more plumbing to facilitate test writing & compatibility.
Also, while here fixed a bug for the PAIR protocol in compat mode. It should now be possible to import more of the nanomsg tests directly with little or no modification.
Diffstat (limited to 'src/nng.h')
-rw-r--r--src/nng.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/nng.h b/src/nng.h
index f9290996..8b4c33e8 100644
--- a/src/nng.h
+++ b/src/nng.h
@@ -371,12 +371,25 @@ NNG_DECL int64_t nng_stat_value(nng_stat *);
// which means that messages from one side are forwarded to the other.
NNG_DECL int nng_device(nng_socket, nng_socket);
-// Sleep for the specified usecs. This is intended for use by test
-// programs (to avoid needing to expose the rest of the private details).
-// Applications are discouraged from using this -- use your platform
-// time services instead.
+// The following functions are not intrinsic to nanomsg, and so do not
+// represent our public API. Avoid their use in other applications.
+
+#ifdef NNG_PRIVATE
+
+// Sleep for specified usecs.
NNG_DECL void nng_usleep(uint64_t);
+// Return usecs since some arbitrary time in past.
+NNG_DECL uint64_t nng_clock(void);
+
+// Create and start a thread.
+NNG_DECL int nng_thread_create(void **, void (*)(void *), void *);
+
+// Destroy a thread (waiting for it to complete.)
+NNG_DECL void nng_thread_destroy(void *);
+
+#endif // NNG_PRIVATE
+
// Pollset functionality. TBD. (Note that I'd rather avoid this
// altogether, because I believe that the notification mechanism I've
// created offers a superior way to handle this. I don't think many