aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-12-11 12:19:37 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-12-11 12:21:36 +0100
commit421ac8dd46ca48742bcf2f896232faa5dd5424bf (patch)
treed133bbac1dcae0fa2e8811bb8b70474c5e7e3a31
parentfe9d459ff91a81cdb1128bbfe913228cbe9b7f40 (diff)
GSM: Make sure the caller of serve is always notified. provide isConnected
-rw-r--r--TestPhone.st14
1 files changed, 11 insertions, 3 deletions
diff --git a/TestPhone.st b/TestPhone.st
index 472464d..4057f2c 100644
--- a/TestPhone.st
+++ b/TestPhone.st
@@ -88,12 +88,20 @@ Object subclass: IPAConfig [
serve [
[
- connection serve.
- 'Connection disconnected' printNl.
- sem signal.
+ [
+ connection serve.
+ 'Connection disconnected' printNl.
+ ] ensure: [
+ connection := nil.
+ sem signal.
+ ]
] fork.
]
+ isConnected [
+ ^ connection isNil not
+ ]
+
semaphore [ ^ sem ]
sendLU: aPhone [