disallowed semaphore removal from a group when a process is waiting for the semaphore to be signaled
This commit is contained in:
@ -218,7 +218,7 @@ method(#class,#abstract) xxx. => method(#class) xxx { self subclassResponsibilit
|
||||
{
|
||||
| x |
|
||||
x := self _addSemaphore: sem.
|
||||
if (x isError) { thisProcess primError dump. Exception signal: ('Cannot add a semaphore - ' & thisProcess primError) }.
|
||||
if (x isError) { Exception signal: ('Cannot add a semaphore - ' & x asString) }.
|
||||
^x
|
||||
}
|
||||
|
||||
@ -226,7 +226,7 @@ method(#class,#abstract) xxx. => method(#class) xxx { self subclassResponsibilit
|
||||
{
|
||||
| x |
|
||||
x := self _removeSemaphore: sem.
|
||||
if (x isError) { thisProcess primError dump. Exception signal: ('Cannot remove a semaphore - ' & thisProcess primError) }.
|
||||
if (x isError) { Exception signal: ('Cannot remove a semaphore - ' & x asString) }.
|
||||
^x
|
||||
}
|
||||
|
||||
@ -234,7 +234,7 @@ method(#class,#abstract) xxx. => method(#class) xxx { self subclassResponsibilit
|
||||
{
|
||||
| x |
|
||||
x := self _wait.
|
||||
if (x isError) { thisProcess primError dump. Exception signal: ('Cannot wait on a semaphore - ' & thisProcess primError) }.
|
||||
if (x isError) { Exception signal: ('Cannot wait on a semaphore - ' & x asString) }.
|
||||
if (x signalAction notNil) { x signalAction value: x }.
|
||||
^x
|
||||
}
|
||||
|
@ -33,6 +33,7 @@ class MyObject(Object)
|
||||
s3 := Semaphore new.
|
||||
|
||||
sg := SemaphoreGroup new.
|
||||
|
||||
sg addSemaphore: s1.
|
||||
sg addSemaphore: s2.
|
||||
sg addSemaphore: s3.
|
||||
|
Reference in New Issue
Block a user