:Something like:
: --gd->gd_curthread->td_critcount;
: for (;;) {
: if (spin->counta == 1)
: continue;
:
: ++gd->gd_curthread->td_critcount;
: cpu_ccfence();
: if (atomic_swap_int(&spin->counta, 1) == 0)
: break;
: --gd->gd_curthread->td_critcount;
It's doable as long as there are no other spinlocks held and the
critical section on entry was not being held. But I don't think
we'll get much out of it because we don't spin on spinlocks very much
any more.
-Matt
