diff options
| author | Garrett D'Amore <garrett@damore.org> | 2016-12-22 20:52:45 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2016-12-22 20:52:45 -0800 |
| commit | ee45cbf4498a3c1d1868469bdb0c767d66c278e4 (patch) | |
| tree | b9116256f12a54c90f92bf5cf215f3d4c8152126 /src/core/platform.h | |
| parent | 718de1828cc5b5256511c5b723360d499ae21c8f (diff) | |
| download | nng-ee45cbf4498a3c1d1868469bdb0c767d66c278e4.tar.gz nng-ee45cbf4498a3c1d1868469bdb0c767d66c278e4.tar.bz2 nng-ee45cbf4498a3c1d1868469bdb0c767d66c278e4.zip | |
Endpoint dialer implemented.
Diffstat (limited to 'src/core/platform.h')
| -rw-r--r-- | src/core/platform.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/core/platform.h b/src/core/platform.h index a674aac5..84477853 100644 --- a/src/core/platform.h +++ b/src/core/platform.h @@ -135,7 +135,7 @@ extern nni_time nni_clock(void); // nni_usleep sleeps for the specified number of microseconds (at least). extern void nni_usleep(nni_duration); -// nni_platform_init is called to allow the platform the chance to +// nni_plat_init is called to allow the platform the chance to // do any necessary initialization. This routine MUST be idempotent, // and threadsafe, and will be called before any other API calls, and // may be called at any point thereafter. It is permitted to return @@ -149,11 +149,18 @@ extern void nni_usleep(nni_duration); // initialize the platform again at a later date. extern int nni_plat_init(int (*)(void)); -// nni_platform_fini is called to clean up resources. It is intended to +// nni_plat_fini is called to clean up resources. It is intended to // be called as the last thing executed in the library, and no other functions // will be called until nni_platform_init is called. extern void nni_plat_fini(void); +// nni_plat_nextid is used to generate a new pipe ID. This should be an +// increasing value, taken from a random starting point. (The randomness +// helps ensure we don't confuse pipe IDs from other connections.) The +// value must be obtained in a threadsafe way (e.g. via an atomic counter +// or under a lock protection.) +extern uint32_t nni_plat_nextid(void); + // Actual platforms we support. This is included up front so that we can // get the specific types that are supplied by the platform. #if defined(PLATFORM_POSIX) |
