Print this page
5042 stop using deprecated atomic functions
*** 656,666 ****
for (ndx = orig = cyclic_coverage_hash(why) % CY_NCOVERAGE; ; ) {
if (cyc_coverage[ndx].cyv_why == why)
break;
if (cyc_coverage[ndx].cyv_why != NULL ||
! casptr(&cyc_coverage[ndx].cyv_why, NULL, why) != NULL) {
if (++ndx == CY_NCOVERAGE)
ndx = 0;
if (ndx == orig)
--- 656,667 ----
for (ndx = orig = cyclic_coverage_hash(why) % CY_NCOVERAGE; ; ) {
if (cyc_coverage[ndx].cyv_why == why)
break;
if (cyc_coverage[ndx].cyv_why != NULL ||
! atomic_cas_ptr(&cyc_coverage[ndx].cyv_why, NULL, why) !=
! NULL) {
if (++ndx == CY_NCOVERAGE)
ndx = 0;
if (ndx == orig)
*** 1217,1229 ****
ASSERT(cyclic->cy_arg == arg);
goto reread;
}
if ((opend =
! cas32(&cyclic->cy_pend, pend, npend)) != pend) {
/*
! * Our cas32 can fail for one of several
* reasons:
*
* (a) An intervening high level bumped up the
* pend count on this cyclic. In this
* case, we will see a higher pend.
--- 1218,1231 ----
ASSERT(cyclic->cy_arg == arg);
goto reread;
}
if ((opend =
! atomic_cas_32(&cyclic->cy_pend, pend, npend)) !=
! pend) {
/*
! * Our atomic_cas_32 can fail for one of several
* reasons:
*
* (a) An intervening high level bumped up the
* pend count on this cyclic. In this
* case, we will see a higher pend.
*** 1309,1319 ****
ASSERT(cpu->cyp_state == CYS_EXPANDING);
do {
lev = cpu->cyp_modify_levels;
nlev = lev + 1;
! } while (cas32(&cpu->cyp_modify_levels, lev, nlev) != lev);
/*
* If we are the last soft level to see the modification,
* post on cyp_modify_wait. Otherwise, (if we're not
* already at low level), post down to the next soft level.
--- 1311,1322 ----
ASSERT(cpu->cyp_state == CYS_EXPANDING);
do {
lev = cpu->cyp_modify_levels;
nlev = lev + 1;
! } while (atomic_cas_32(&cpu->cyp_modify_levels, lev, nlev) !=
! lev);
/*
* If we are the last soft level to see the modification,
* post on cyp_modify_wait. Otherwise, (if we're not
* already at low level), post down to the next soft level.