Skip to content

Commit e1811cf

Browse files
committed
opal/threads: protect opal_tsd_keys_destruct() to fix Java bindings.
When Java bindings are used, MPI_Init() is not invoked by the main thread, and this causes some keys being destructed twice. Reset the per thread values to NULL in order to correctly handle this Fixes #2811 Signed-off-by: Gilles Gouaillardet <[email protected]>
1 parent c6595c2 commit e1811cf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

opal/threads/thread.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ int opal_tsd_keys_destruct()
117117
if(OPAL_SUCCESS == opal_tsd_getspecific(opal_tsd_key_values[i].key, &ptr)) {
118118
if (NULL != opal_tsd_key_values[i].destructor) {
119119
opal_tsd_key_values[i].destructor(ptr);
120+
opal_tsd_setspecific(opal_tsd_key_values[i].key, NULL);
120121
}
121122
}
122123
}

0 commit comments

Comments
 (0)