All pastes #11193 Raw Edit

Unnamed

public text v1 · immutable
#11193 ·published 2005-05-07 23:39 UTC
rendered paste body
spinlock()
{
        _tries=0
        _lock_cond="mv ${_PKGLIST_LOCK} ${_PKGLIST_LOCKTIME}"
        while ! $_lock_cond > /dev/null 2>&1; do
                sleep 1;
                echo -n ".${_tries}";
                _tries=`expr $_tries + 1`;
        done
        [ 0 -lt $_tries ] && echo
}

spinunlock()
{
        mv ${_PKGLIST_LOCKTIME} ${_PKGLIST_LOCK}
}