blob: 5f1e2a8d0bffafc72f0e57357f860dc43f97058e [file] [log] [blame]
/*
* Avoid using threading calls for single-proc programs.
*/
#include "threadimpl.h"
static int multi;
static Proc *theproc;
void
_threadsetproc(Proc *p)
{
if(!multi)
theproc = p;
else
_kthreadsetproc(p);
}
Proc*
_threadgetproc(void)
{
if(!multi)
return theproc;
return _kthreadgetproc();
}
void
_threadmultiproc(void)
{
if(multi)
return;
multi = 1;
_kthreadinit();
_threadsetproc(theproc);
}