From fa94fcde43d1c87745bcdbf25b4fa6242d5b1834 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 15 Apr 2008 17:15:28 +0000 Subject: [PATCH] add setDone() to finalize result git-svn-id: http://trooper/svn/projects/jFCPlib/branch/high-level-client@823 c3eda9e8-030b-0410-8277-bc7414b0a119 --- .../pterodactylus/fcp/highlevel/HighLevelCallback.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/net/pterodactylus/fcp/highlevel/HighLevelCallback.java b/src/net/pterodactylus/fcp/highlevel/HighLevelCallback.java index aed413d..3e3e70f 100644 --- a/src/net/pterodactylus/fcp/highlevel/HighLevelCallback.java +++ b/src/net/pterodactylus/fcp/highlevel/HighLevelCallback.java @@ -185,4 +185,20 @@ public class HighLevelCallback { } } + /** + * Marks the result given in with + * {@link #setResult(HighLevelResult, boolean)} as complete and notify the + * listeners. If the result was already complete, nothing will be done. + */ + void setDone() { + synchronized (syncObject) { + if (resultComplete) { + return; + } + resultComplete = true; + syncObject.notify(); + } + fireGotResult(); + } + } -- 2.7.4