split alias flag macro so that it works for context thread, etc
authorGengbin Zheng <gzheng@illinois.edu>
Sun, 15 Jan 2006 18:08:17 +0000 (18:08 +0000)
committerGengbin Zheng <gzheng@illinois.edu>
Sun, 15 Jan 2006 18:08:17 +0000 (18:08 +0000)
src/conv-core/converse.h
src/conv-core/threads.c

index 7df569f69992b70083236dfbbd71212071b5370d..bdfd1906b01c2505998421b35ff25d910e6b3450 100644 (file)
@@ -536,7 +536,7 @@ int CmiMemoryIs(int flag); /* return state of this flag */
 #define CMI_THREAD_IS_UJCONTEXT  (1<<3)
 #define CMI_THREAD_IS_PTHREADS   (1<<4)
 #define CMI_THREAD_IS_FIBERS     (1<<5)
-#define CMI_THREAD_IS_QT_ALIAS   (1<<6)
+#define CMI_THREAD_IS_ALIAS      (1<<6)
 #define CMI_THREAD_IS_STACKCOPY  (1<<7)
 int CmiThreadIs(int flag); /* return state of this flag */
 
index d13c1081a74601fc02e17e71f2728abceda23f6a..8b4b6a3231c03adb9772dfa7efd888130a02df9e 100644 (file)
@@ -373,9 +373,9 @@ static void CthThreadBaseInit(CthThreadBase *th)
   __pthread_find_self_with_pid=1;
   __pthread_nonstandard_stacks=1;
 #endif
-       th->token = (CthThreadToken *)malloc(sizeof(CthThreadToken));
-       th->token->thread = S(th);
-       th->scheduled = 0;
+  th->token = (CthThreadToken *)malloc(sizeof(CthThreadToken));
+  th->token->thread = S(th);
+  th->scheduled = 0;
 
   th->awakenfn = 0;
   th->choosefn = 0;
@@ -1302,6 +1302,9 @@ void CthInit(char **argv)
 #else
   CmiThreadIs_flag |= CMI_THREAD_IS_UJCONTEXT;
 #endif
+#if CMK_THREADS_ALIAS_STACK
+  CmiThreadIs_flag |= CMI_THREAD_IS_ALIAS;
+#endif
 }
 
 static void CthThreadFree(CthThread t)
@@ -1433,7 +1436,11 @@ CthThread CthPup(pup_er p, CthThread t)
          _MEMCHECK(t);
          CthThreadInit(t);
   }
+#if CMK_THREADS_ALIAS_STACK
+  CthPupBase(p,&t->base,0);
+#else
   CthPupBase(p,&t->base,1);
+#endif
   
   /*Pup the processor context as bytes-- this is not guarenteed to work!*/
   pup_bytes(p,&t->context,sizeof(t->context));
@@ -1518,10 +1525,9 @@ void CthInit(char **argv)
   CthCpvAccess(CthCurrent)=mainThread;
   /* mainThread->base.suspendable=0;*/ /*Can't suspend main thread (trashes Quickthreads jump buffer)*/
 
-#if CMK_THREADS_ALIAS_STACK
-  CmiThreadIs_flag |= CMI_THREAD_IS_QT_ALIAS;
-#else
   CmiThreadIs_flag |= CMI_THREAD_IS_QT;
+#if CMK_THREADS_ALIAS_STACK
+  CmiThreadIs_flag |= CMI_THREAD_IS_ALIAS;
 #endif
 }