RegressionTests__ContextTest2.st
author Claus Gittinger <cg@exept.de>
Sat, 31 Mar 2001 17:38:55 +0200
changeset 101 7ea8b99a38d8
parent 100 34d87daf0f75
child 102 f9c4503da06d
permissions -rw-r--r--
checkin from browser

"{ Package: 'exept:regression' }"

"{ NameSpace: RegressionTests }"

TestCase subclass:#ContextTest2
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Tests-Regression'
!


!ContextTest2 methodsFor:'tests'!

testProcess1
    |x set lockSet p arg|

    lockSet := Semaphore forMutualExclusion.
    set := Set new.

    x := 1 @ 1.

    arg := x.

    p := [
        [
            lockSet critical:[set add:arg].
            arg perform:#x .
        ] valueNowOrOnUnwindDo:[
            lockSet critical:[set remove:arg].
        ].
    ] fork.

    "
     self new testProcess1
    "
!

testProcess2
    |x set lockSet p|

    lockSet := Semaphore forMutualExclusion.
    set := Set new.

    x := 1 @ 1.

    p := [:arg |
        [
            lockSet critical:[set add:arg].
            arg perform:#x: with:1234.
        ] valueNowOrOnUnwindDo:[
            lockSet critical:[set remove:arg].
        ].
    ] forkWith:(Array with:x).

    "
     self new testProcess2
    "
! !

!ContextTest2 class methodsFor:'documentation'!

version
    ^ '$Header$'
! !