1
1

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 open-mpi/ompi#2811

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
Этот коммит содержится в:
Gilles Gouaillardet 2017-01-25 10:57:14 +09:00
родитель c6595c2289
Коммит e1811cfe17

Просмотреть файл

@ -117,6 +117,7 @@ int opal_tsd_keys_destruct()
if(OPAL_SUCCESS == opal_tsd_getspecific(opal_tsd_key_values[i].key, &ptr)) {
if (NULL != opal_tsd_key_values[i].destructor) {
opal_tsd_key_values[i].destructor(ptr);
opal_tsd_setspecific(opal_tsd_key_values[i].key, NULL);
}
}
}