module examples.lock; behavior WriteLine { File file; String [] words; int lineNo; WriteLine(File f, int lNo, String [] words){ this.file = f; this.lineNo = lNo; this.words = words; } void writeWord(String word){ file<-writeWord(word) @ currentContinuation; } void go(){ file<-canIUse(self) @ use(token); } void use(boolean ok){ if (ok) { writeWord("\n"+lineNo+"\t"); join { for (int i=0; i< words.length; i++){ writeWord(words[i]+" "); } } @ file<-release(); } else { go(); } } }