libthread: make page work on OS X

This commit is contained in:
Russ Cox 2009-08-17 17:29:44 -07:00
parent 5186b55afc
commit 0829f75bba
2 changed files with 5 additions and 0 deletions

View file

@ -155,6 +155,10 @@ _threadcreate(Proc *p, void (*fn)(void*), void *arg, uint stack)
{
_Thread *t;
/* defend against bad C libraries */
if(stack < (256<<10))
stack = 256<<10;
t = threadalloc(fn, arg, stack);
t->proc = p;
addthreadinproc(p, t);