completed Apex>>basicAt:test:put.

changed BlockContext>>ensure: and Context>>unwindTo:return: to use basicAt:test:put to make the test-and-set operation uninterruptible
This commit is contained in:
hyunghwan.chung
2019-08-17 06:30:34 +00:00
parent f3953c4754
commit a65b64a0d9
3 changed files with 53 additions and 24 deletions

View File

@ -177,11 +177,13 @@ extend Context
* if the block has been evaluated. see the method BlockContext>>ensure:.
* it is the position of the last temporary variable of the method */
pending_pos := ctx basicSize - 1.
/*
if (ctx basicAt: pending_pos)
{
ctx basicAt: pending_pos put: false.
eb value.
}
}*/
if (ctx basicAt: pending_pos test: true put: false) { eb value }.
}.
stop := (ctx == context).
ctx := ctx sender.
@ -392,7 +394,8 @@ thisContext isExceptionContext dump.
/* the temporary variable 'pending' may get changed
* during evaluation for exception handling.
* it gets chagned in Context>>unwindTo:return: */
if (pending) { pending := false. aBlock value }.
/*if (pending) { pending := false. aBlock value }.*/
if (thisContext basicAt: (thisContext basicSize - 1) test: true put: false) { aBlock value }.
^retval
}