equal
deleted
inserted
replaced
19428 */ |
19428 */ |
19429 public final native boolean compareAndSwapInt(Object o, long offset, |
19429 public final native boolean compareAndSwapInt(Object o, long offset, |
19430 long expected, |
19430 long expected, |
19431 long new); |
19431 long new); |
19432 " |
19432 " |
19433 | o offset expected real new ok | |
19433 | o offset expected real new ok wasBlocked| |
|
19434 |
19434 o := a1. |
19435 o := a1. |
19435 offset := a2. |
19436 offset := a2. |
19436 "offset is long, so nativeContext at:3 is dummy nil!!!!!!" |
19437 "offset is long, so nativeContext at:3 is dummy nil!!!!!!" |
19437 expected := a4. |
19438 expected := a4. |
19438 new := a6. |
19439 new := a6. |
19439 |
19440 |
19440 OperatingSystem blockInterrupts. |
19441 wasBlocked := OperatingSystem blockInterrupts. |
19441 real := o instVarAt: offset. |
19442 real := o instVarAt: offset. |
19442 (real == expected) |
19443 (real == expected) |
19443 ifTrue:[o instVarAt: offset put: new. ok := 1] |
19444 ifTrue:[o instVarAt: offset put: new. ok := 1] |
19444 ifFalse:[ok := 1]. |
19445 ifFalse:[ok := 1]. |
19445 OperatingSystem unblockInterrupts. |
19446 wasBlocked ifFalse:[ OperatingSystem unblockInterrupts ]. |
19446 ^ok |
19447 ^ok |
19447 |
19448 |
19448 "Modified: / 18-10-2011 / 21:59:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
19449 "Modified: / 18-10-2011 / 21:59:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
19449 ! |
19450 ! |
19450 |
19451 |
19460 */ |
19461 */ |
19461 public final native boolean compareAndSwapInt(Object o, long offset, |
19462 public final native boolean compareAndSwapInt(Object o, long offset, |
19462 int expected, |
19463 int expected, |
19463 int new); |
19464 int new); |
19464 " |
19465 " |
19465 | o offset expected real new ok isArray| |
19466 | o offset expected real new ok isArray wasBlocked| |
19466 |
19467 |
19467 o := a1. |
19468 o := a1. |
19468 offset := a2. |
19469 offset := a2. |
19469 "offset is long, so nativeContext at:3 is dummy nil!!!!!!" |
19470 "offset is long, so nativeContext at:3 is dummy nil!!!!!!" |
19470 expected := a4. |
19471 expected := a4. |
19471 new := a5. |
19472 new := a5. |
19472 |
19473 |
19473 OperatingSystem blockInterrupts. |
19474 wasBlocked := OperatingSystem blockInterrupts. |
19474 (isArray := o isArray) ifTrue:[ |
19475 (isArray := o isArray) ifTrue:[ |
19475 real := o at: offset. |
19476 real := o at: offset. |
19476 ] ifFalse:[ |
19477 ] ifFalse:[ |
19477 real := o instVarAt: offset. |
19478 real := o instVarAt: offset. |
19478 ]. |
19479 ]. |
19485 ]. |
19486 ]. |
19486 ok := 1 |
19487 ok := 1 |
19487 ] ifFalse:[ |
19488 ] ifFalse:[ |
19488 ok := 0 |
19489 ok := 0 |
19489 ]. |
19490 ]. |
19490 OperatingSystem unblockInterrupts. |
19491 wasBlocked ifFalse:[ OperatingSystem unblockInterrupts ]. |
19491 ^ok |
19492 ^ok |
19492 |
19493 |
19493 "Modified: / 08-02-2013 / 09:24:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
19494 "Modified: / 08-02-2013 / 09:24:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
19494 ! |
19495 ! |
19495 |
19496 |