diff options
Diffstat (limited to 'lib/qpnexus.h')
-rw-r--r-- | lib/qpnexus.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/qpnexus.h b/lib/qpnexus.h index 69fe8044..c717ed23 100644 --- a/lib/qpnexus.h +++ b/lib/qpnexus.h @@ -80,19 +80,28 @@ struct qpn_nexus mqueue_queue queue; mqueue_thread_signal mts; - /* qpthread routine */ + /* legacy threads */ + struct thread_master *master; + + /* qpthread routine, can override */ void* (*start)(void*); + /* in-thread initialize, can override. Called within the thread + * after all other initializion just before thread loop */ + void (*in_thread_init)(void); + + /* in-thread finalize, can override. Called within thread + * just before thread dies. Nexus components all exist but + * thread loop is no longer executed */ + void (*in_thread_final)(void); + }; /*============================================================================== * Functions */ -extern qpn_nexus qpn_init_new(qpn_nexus qtn); -extern qpn_nexus qpn_init_main(qpn_nexus qtn); -extern qpn_nexus qpn_init_bgp(qpn_nexus qtn); -extern qpn_nexus qpn_init_routing(qpn_nexus qtn); +extern qpn_nexus qpn_init_new(qpn_nexus qtn, int main_thread); extern void qpn_exec(qpn_nexus qtn); extern void qpn_terminate(qpn_nexus qpn); extern qpn_nexus qpn_free(qpn_nexus qpn); |