1
/ See the file LICENSE for redistribution information.
3
/ Copyright (c) 1997-2002
4
/ Sleepycat Software. All rights reserved.
8
/ int uts_lock ( int *p, int i );
9
/ Update the lock word pointed to by p with the
10
/ value i, using compare-and-swap.
11
/ Returns 0 if update was successful.
12
/ Returns 1 if update failed.
18
l r2,64+0(sp) / R2 -> word to update
19
slr r0, r0 / R0 = current lock value must be 0
20
l r1,64+4(sp) / R1 = new lock value
21
cs r0,r1,0(r2) / Try the update ...
22
be x / ... Success. Return 0
23
la r0,1 / ... Failure. Return 1
25
l r2,8(sp) / Restore R2
26
b 2(,r14) / Return to caller