diff options
Diffstat (limited to 'src/pkg/runtime')
| -rw-r--r-- | src/pkg/runtime/mgc0.c | 10 | ||||
| -rw-r--r-- | src/pkg/runtime/proc.c | 20 |
2 files changed, 27 insertions, 3 deletions
diff --git a/src/pkg/runtime/mgc0.c b/src/pkg/runtime/mgc0.c index aa93bfbeda..8b6eeab105 100644 --- a/src/pkg/runtime/mgc0.c +++ b/src/pkg/runtime/mgc0.c @@ -68,15 +68,19 @@ clearpools(void) { void **pool, **next; P *p, **pp; + uintptr off; int32 i; // clear sync.Pool's for(pool = pools.head; pool != nil; pool = next) { next = pool[0]; pool[0] = nil; // next - pool[1] = nil; // slice - pool[2] = nil; - pool[3] = nil; + pool[1] = nil; // local + pool[2] = nil; // localSize + off = (uintptr)pool[3] / sizeof(void*); + pool[off+0] = nil; // global slice + pool[off+1] = nil; + pool[off+2] = nil; } pools.head = nil; diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c index 24feda4183..afe71ef69e 100644 --- a/src/pkg/runtime/proc.c +++ b/src/pkg/runtime/proc.c @@ -3046,3 +3046,23 @@ haveexperiment(int8 *name) } return 0; } + +// func runtime_procPin() int +void +sync·runtime_procPin(intgo p) +{ + M *mp; + + mp = m; + // Disable preemption. + mp->locks++; + p = mp->p->id; + FLUSH(&p); +} + +// func runtime_procUnpin() +void +sync·runtime_procUnpin(void) +{ + m->locks--; +} |
