Do not use setjmp/longjmp in multithreaded code. It will destroy the stack.
int GlobalStatus;
+#ifdef JUMP
unsigned int MainThreadId;
jmp_buf notifier_jmp;
+#endif /* JUMP */
extern int traceOnPanic;
extern HANDLE afsi_file;
SetEvent(WaitToTerminate);
+#ifdef JUMP
if (GetCurrentThreadId() == MainThreadId)
longjmp(notifier_jmp, 1);
else
+#endif /* JUMP */
ExitThread(1);
}
}
}
+#ifdef JUMP
MainThreadId = GetCurrentThreadId();
jmpret = setjmp(notifier_jmp);
- if (jmpret == 0) {
+ if (jmpret == 0)
+#endif /* JUMP */
+ {
code = afsd_InitCM(&reason);
if (code != 0)
osi_panic(reason, __FILE__, __LINE__);