* 0 success, -1 error
*
*/
+DAT_UINT32 g_parent = 0;
int32_t dapls_ib_init(void)
{
- dapl_dbg_log(DAPL_DBG_TYPE_UTIL, " dapl_ib_init: \n");
+ g_parent = dapl_os_getpid();
/* initialize hca_list lock */
dapl_os_lock_init(&g_hca_lock);
int32_t dapls_ib_release(void)
{
- dapl_dbg_log(DAPL_DBG_TYPE_UTIL, " dapl_ib_release: \n");
+ /* only parent will cleanup */
+ if (dapl_os_getpid() != g_parent)
+ return 0;
+
dapli_ib_thread_destroy();
if (g_cm_events != NULL)
rdma_destroy_event_channel(g_cm_events);
* 0 success, -1 error
*
*/
+DAT_UINT32 g_parent = 0;
int32_t dapls_ib_init(void)
{
+ g_parent = dapl_os_getpid();
+
/* initialize hca_list */
dapl_os_lock_init(&g_hca_lock);
dapl_llist_init_head(&g_hca_list);
int32_t dapls_ib_release(void)
{
+ /* only parent init will cleanup */
+ if (dapl_os_getpid() != g_parent)
+ return 0;
+
dapli_ib_thread_destroy();
dapls_os_release();
return 0;