diff options
| author | Garrett D'Amore <garrett@damore.org> | 2016-12-12 12:23:32 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2016-12-12 12:23:32 -0800 |
| commit | 0991802d1c91c790c60828145ddecbfe1583f6db (patch) | |
| tree | dc2e47e482dba13fa789a6946c16f0a934abdda4 /src/core/transport.h | |
| parent | 1adefe3879b211a47a784f477d56a9416ae72254 (diff) | |
| download | nng-0991802d1c91c790c60828145ddecbfe1583f6db.tar.gz nng-0991802d1c91c790c60828145ddecbfe1583f6db.tar.bz2 nng-0991802d1c91c790c60828145ddecbfe1583f6db.zip | |
Added threading primitives, more complete transport API.
Diffstat (limited to 'src/core/transport.h')
| -rw-r--r-- | src/core/transport.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/core/transport.h b/src/core/transport.h index 567cc0c5..65f1976e 100644 --- a/src/core/transport.h +++ b/src/core/transport.h @@ -43,6 +43,28 @@ struct nni_transport_ops { * tran_pipe_ops links our pipe operations. */ const struct nni_pipe_ops *tran_pipe_ops; + + /* + * tran_init, if not NULL, is called once during library + * initialization. + */ + int (*tran_init)(void); + + /* + * tran_fini, if not NULL, is called during library deinitialization. + * It should release any global resources. + */ + void (*tran_fini)(void); + + /* + * tran_fork, if not NULL, is called just before fork + * (e.g. during pthread_atfork() for the prefork phase), + * and again just after returning in the parent. There is + * nothing called for the child. If the transport does not + * create any threads of its own, this can be NULL. (The + * intended use is to prevent O_CLOEXEC races.) + */ + void (*tran_fork)(int prefork); }; struct nni_endpt_ops { |
