Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!f11g2000vbx.googlegroups.com!not-for-mail From: Paul Cager Newsgroups: comp.lang.java.programmer Subject: Re: Making one or more threads wait for another to produce a value or fail Date: Tue, 31 May 2011 10:08:36 -0700 (PDT) Organization: http://groups.google.com Lines: 8 Message-ID: <4d858520-4121-45f2-a0cc-82e1a1cbd37d@f11g2000vbx.googlegroups.com> References: NNTP-Posting-Host: 81.94.213.9 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1306861717 23058 127.0.0.1 (31 May 2011 17:08:37 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 31 May 2011 17:08:37 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: f11g2000vbx.googlegroups.com; posting-host=81.94.213.9; posting-account=VsWLXwoAAAB13M2Ptt5-Bo-K_zCx-zyw User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HNKRUAELSC X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.24,gzip(gfe) Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:4802 On May 31, 5:06=A0pm, Patricia Shanahan wrote: > One way to do the synchronization would be a semaphore that is initially > zero, but with a large number of permits added when Penelope calls a > setVerdict method. The getVerdict method that the suitors call would > wait to get a permit, record the verdict, and put the permit back so > there is no possibility of running out of permits. Could you not subclass CountDownLatch and add a "verdict" property?