Commit 90653d78 authored by Sanjay Menakuru's avatar Sanjay Menakuru Committed by Dmitriy Vyukov

runtime,sync: Convert procPin and procUnpin functions to Go.

LGTM=dvyukov
R=golang-codereviews, dvyukov
CC=golang-codereviews, khr
https://golang.org/cl/132880043
parent 32c0dce0
......@@ -3292,3 +3292,23 @@ haveexperiment(int8 *name)
}
return 0;
}
#pragma textflag NOSPLIT
void
sync·runtime_procPin(intptr p)
{
M *mp;
mp = g->m;
// Disable preemption.
mp->locks++;
p = mp->p->id;
FLUSH(&p);
}
#pragma textflag NOSPLIT
void
sync·runtime_procUnpin()
{
g->m->locks--;
}
......@@ -114,15 +114,3 @@ func runtime∕pprof·runtime_cyclesPerSecond() (res int64) {
res = runtime·tickspersecond();
}
func sync·runtime_procPin() (p int) {
M *mp;
mp = g->m;
// Disable preemption.
mp->locks++;
p = mp->p->id;
}
func sync·runtime_procUnpin() {
g->m->locks--;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment