PREV UP NEXT StackThreads/MP: version 0.77 User's Guide

3.4.2: Reading and Checking Locations

        int st_read_int(il);
@        long st_read_long(ll);
@        void * st_read_ptr(pl);

@        int ST_INT_LOC_CHECK(il, i);
@        int ST_LONG_LOC_CHECK(ll, l);
@        int ST_PTR_LOC_CHECK(pl, p);

@        int ST_INT_LOC_LOCKED(il);
@        int ST_LONG_LOC_LOCKED(ll);
@        int ST_PTR_LOC_LOCKED(pl);

st_read_int(il) reads the value at the location pointed to by il, but does not lock the location. It can immediately read the value even if the location is locked. st_read_long(ll) and st_read_ptr(pl) are similar procedures for locations of type st_long_loc_t * and st_long_ptr_t *.

ST_INT_LOC_CHECK(il, i) is 1 when il is currently unlocked and its value equals to i. This is semantically equivalent to (st_read_int(il) == i), but on some CPUs, the former is considerably faster. ST_LONG_LOC_CHECK(ll, l) and ST_PTR_LOC_CHECK(pl, p) are similar primitives for st_long_loc_t * and st_ptr_loc_t *, respectively.

ST_INT_LOC_LOCKED(il) is 1 if the location il is currently locked. ST_LONG_LOC_LOCKED(ll) and ST_PTR_LOC_LOCKED(pl) are similar primitives for st_long_loc_t * and st_ptr_loc_t *, respectively.