[mpich2-commits] r6674 - mpich2/trunk/src/include

goodell at mcs.anl.gov goodell at mcs.anl.gov
Tue May 18 15:37:15 CDT 2010


Author: goodell
Date: 2010-05-18 15:37:15 -0500 (Tue, 18 May 2010)
New Revision: 6674

Modified:
   mpich2/trunk/src/include/mpiimplthread.h
Log:
bug fix for r6664: THREADPRIV_FINALIZE should be conditional

At one point the init macros were also unconditional, but then they
were updated and FINALIZE was missed.

No reviewer.

Modified: mpich2/trunk/src/include/mpiimplthread.h
===================================================================
--- mpich2/trunk/src/include/mpiimplthread.h	2010-05-18 20:29:48 UTC (rev 6673)
+++ mpich2/trunk/src/include/mpiimplthread.h	2010-05-18 20:37:15 UTC (rev 6674)
@@ -273,13 +273,15 @@
 /* common definitions when using MPID_Thread-based TLS */
 #define MPIU_THREADPRIV_DECL MPICH_PerThread_t *MPIR_Thread=NULL
 #define MPIU_THREADPRIV_FIELD(a_) (MPIR_Thread->a_)
-#define MPIU_THREADPRIV_FINALIZE                                       \
-    do {                                                               \
-        MPIU_THREADPRIV_DECL;                                          \
-        MPIU_THREADPRIV_GET;                                           \
-        MPIU_Free(MPIR_Thread);                                        \
-        MPID_Thread_tls_set(&MPIR_ThreadInfo.thread_storage,NULL);     \
-        MPID_Thread_tls_destroy(&MPIR_ThreadInfo.thread_storage,NULL); \
+#define MPIU_THREADPRIV_FINALIZE                                           \
+    do {                                                                   \
+        MPIU_THREADPRIV_DECL;                                              \
+        if (MPIU_ISTHREADED) {                                             \
+            MPIU_THREADPRIV_GET;                                           \
+            MPIU_Free(MPIR_Thread);                                        \
+            MPID_Thread_tls_set(&MPIR_ThreadInfo.thread_storage,NULL);     \
+            MPID_Thread_tls_destroy(&MPIR_ThreadInfo.thread_storage,NULL); \
+        }                                                                  \
     } while (0)
 
 #else /* defined(MPIU_TLS_SPECIFIER) */



More information about the mpich2-commits mailing list