commit - b50e9caf31a0d1346bf782c6b4e32f90fd707223
commit + 0b561695d60ce777fbfb332a436c2a51702fae23
blob - d79bd1a9a29416ae25f9173bbc89cef36c642e68
blob + 6c31cb76ba8d1f0107b0ebe008f30e4b3937e5be
--- src/libthread/thread.c
+++ src/libthread/thread.c
threadmainstart(void *v)
{
USED(v);
+
+ /*
+ * N.B. This call to proc() is a program's first call (indirectly) to a
+ * pthreads function while executing on a non-pthreads-allocated
+ * stack. If the pthreads implementation is using the stack pointer
+ * to locate the per-thread data, then this call will blow up.
+ * This means the pthread implementation is not suitable for
+ * running under libthread. Time to write your own. Sorry.
+ */
threadmainproc = proc();
threadmain(threadargc, threadargv);
}