use Ckpv on currentChareIdx
[charm.git] / src / conv-core / threads.c
index 10e0bea44e4de92b1a397cbd5ea81702121d7fe3..44e52cd5f6196e8251d3fc515c06df10aa271c6c 100644 (file)
@@ -605,6 +605,17 @@ static void CthThreadFinished(CthThread t)
        CthSuspend();
 }
 
+void CthSetMagic(CthThread t)
+{
+       *((int*)(B(t)->stack + B(t)->stacksize) -1) = THD_MAGIC_NUM;
+}
+
+void CthCheckMagic(CthThread t)
+{
+printf("CthCheckMagic\n");
+       if (*((int*)(B(t)->stack + B(t)->stacksize) -1) != THD_MAGIC_NUM)
+               CmiAbort("Charm++: CthThread stack overflow detected.");
+}
 
 /************ Scheduler Interface **********/