Documentation for sub atomic-fetch-sub
Documentation for sub atomic-fetch-sub, assembled from the following types:
multi sub atomic-fetch-sub(atomicint $ is rw, int )multi sub atomic-fetch-sub(atomicint $ is rw, Int() )
Performs an atomic subtraction on a native integer. This will be performed using hardware-provided atomic operations. Since the operation is atomic, it is safe to use without acquiring a lock. Returns the value as seen before the subtraction was performed. Underflow will wrap around silently. If
$value is too big to unbox to a 64-bit integer, an exception will be thrown. If
$value otherwise overflows
atomicint then it will be silently truncated before the subtraction is performed.