RegressionTests__ContextTest2.st
changeset 669 2d182f7b5258
parent 654 fbf6fc76b0fa
child 1157 459cbf85d7f0
equal deleted inserted replaced
668:9481f512e9b8 669:2d182f7b5258
   336     x := 1 @ 1.
   336     x := 1 @ 1.
   337 
   337 
   338     arg := x.
   338     arg := x.
   339 
   339 
   340     p := [
   340     p := [
   341 	[
   341         [
   342 	    lockSet critical:[set add:arg].
   342             lockSet critical:[set add:arg].
   343 	    arg perform:#x .
   343             arg perform:#x .
   344 	] valueNowOrOnUnwindDo:[
   344         ] ensure:[
   345 	    lockSet critical:[set remove:arg].
   345             lockSet critical:[set remove:arg].
   346 	].
   346         ].
   347     ] fork.
   347     ] fork.
   348 
   348 
   349     "
   349     "
   350      self new testProcess1
   350      self new testProcess1
   351     "
   351     "
   358     set := Set new.
   358     set := Set new.
   359 
   359 
   360     x := 1 @ 1.
   360     x := 1 @ 1.
   361 
   361 
   362     p := [:arg |
   362     p := [:arg |
   363 	[
   363         [
   364 	    lockSet critical:[set add:arg].
   364             lockSet critical:[set add:arg].
   365 	    arg perform:#x.
   365             arg perform:#x.
   366 	] valueNowOrOnUnwindDo:[
   366         ] ensure:[
   367 	    lockSet critical:[set remove:arg].
   367             lockSet critical:[set remove:arg].
   368 	].
   368         ].
   369     ] forkWith:(Array with:x).
   369     ] forkWith:(Array with:x).
   370 
   370 
   371     "
   371     "
   372      self new testProcess2
   372      self new testProcess2
   373     "
   373     "
   380     set := Set new.
   380     set := Set new.
   381 
   381 
   382     x := 1 @ 1.
   382     x := 1 @ 1.
   383 
   383 
   384     p := [:arg |
   384     p := [:arg |
   385 	[
   385         [
   386 	    lockSet critical:[set add:arg].
   386             lockSet critical:[set add:arg].
   387 	    arg perform:#x: with:1234.
   387             arg perform:#x: with:1234.
   388 	] valueNowOrOnUnwindDo:[
   388             lockSet critical:[set rehash].
   389 	    lockSet critical:[set remove:arg].
   389         ] ensure:[
   390 	].
   390             lockSet critical:[set remove:arg].
       
   391         ].
   391     ] forkWith:(Array with:x).
   392     ] forkWith:(Array with:x).
   392 
   393 
   393     "
   394     "
   394      self new testProcess3
   395      self new testProcess3
   395     "
   396     "
   449 
   450 
   450     <context: #return>
   451     <context: #return>
   451 
   452 
   452     |ex|
   453     |ex|
   453 
   454 
   454     ex := self newExceptionFrom:someone.
   455     ex := self newException.
   455 someone exceptionObjectIs:ex.
   456 someone exceptionObjectIs:ex.
   456     ^ (ex
   457     ^ (ex
   457         suspendedContext:thisContext sender
   458         suspendedContext:thisContext sender
   458         parameter:someone)
   459         parameter:someone originator:someone)
   459             raiseRequest.
   460             raiseRequest.
   460 ! !
   461 ! !
   461 
   462 
   462 !ContextTest2 class methodsFor:'documentation'!
   463 !ContextTest2 class methodsFor:'documentation'!
   463 
   464