Print this page
5042 stop using deprecated atomic functions
*** 796,806 ****
if ((oldrtfu & DBLK_RTFU_REF_MASK) == DBLK_RTFU_REF_MASK) {
kmem_cache_free(mblk_cache, new_mp);
new_mp = NULL;
goto out;
}
! } while (cas32(&DBLK_RTFU_WORD(dbp), oldrtfu, newrtfu) != oldrtfu);
out:
FTRACE_1("dupb(): new_mp=0x%lx", (uintptr_t)new_mp);
return (new_mp);
}
--- 796,807 ----
if ((oldrtfu & DBLK_RTFU_REF_MASK) == DBLK_RTFU_REF_MASK) {
kmem_cache_free(mblk_cache, new_mp);
new_mp = NULL;
goto out;
}
! } while (atomic_cas_32(&DBLK_RTFU_WORD(dbp), oldrtfu, newrtfu) !=
! oldrtfu);
out:
FTRACE_1("dupb(): new_mp=0x%lx", (uintptr_t)new_mp);
return (new_mp);
}
*** 4248,4258 ****
* Just in case there is another thread about
* to get the next index, we need to make sure
* the value is there for it.
*/
membar_producer();
! if (casptr(&hp->tail, bp, nbp) == bp) {
/* CAS was successful */
bp->nxt = nbp;
membar_producer();
bp = nbp;
ix = 0;
--- 4249,4259 ----
* Just in case there is another thread about
* to get the next index, we need to make sure
* the value is there for it.
*/
membar_producer();
! if (atomic_cas_ptr(&hp->tail, bp, nbp) == bp) {
/* CAS was successful */
bp->nxt = nbp;
membar_producer();
bp = nbp;
ix = 0;
*** 4262,4272 ****
bp = hp->tail;
continue;
}
}
nix = ix + 1;
! if (cas32((uint32_t *)&bp->ix, ix, nix) == ix) {
cas_good:
if (curthread != hp->thread) {
hp->thread = curthread;
evnt |= FTEV_CS;
}
--- 4263,4273 ----
bp = hp->tail;
continue;
}
}
nix = ix + 1;
! if (atomic_cas_32((uint32_t *)&bp->ix, ix, nix) == ix) {
cas_good:
if (curthread != hp->thread) {
hp->thread = curthread;
evnt |= FTEV_CS;
}