lw $t0, 0(glob) addi $t0, $t0, 1 sw $t0, 0(glob)
if (M[adr] == 0) { M[adr] = 1 return success } else { return fail }
lock the mutex associated with a critical variable update the variable unlock the mutex associated with that variable.
struct timespec { __time_t tv_sec; /* Seconds. */ __syscall_slong_t tv_nsec; /* Nanoseconds. */ }