aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/linux/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/runtime/linux/thread.c')
-rw-r--r--src/pkg/runtime/linux/thread.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/pkg/runtime/linux/thread.c b/src/pkg/runtime/linux/thread.c
index 4878a00f25..bf3b0947d6 100644
--- a/src/pkg/runtime/linux/thread.c
+++ b/src/pkg/runtime/linux/thread.c
@@ -8,7 +8,6 @@
#include "stack.h"
extern SigTab runtime·sigtab[];
-static int32 proccount;
int32 runtime·open(uint8*, int32, int32);
int32 runtime·close(int32);
@@ -136,13 +135,10 @@ futexlock(Lock *l)
// its wakeup call.
wait = v;
- if(proccount == 0)
- proccount = getproccount();
-
// On uniprocessor's, no point spinning.
// On multiprocessors, spin for ACTIVE_SPIN attempts.
spin = 0;
- if(proccount > 1)
+ if(runtime·ncpu > 1)
spin = ACTIVE_SPIN;
for(;;) {
@@ -276,6 +272,7 @@ runtime·newosproc(M *m, G *g, void *stk, void (*fn)(void))
void
runtime·osinit(void)
{
+ runtime·ncpu = getproccount();
}
void