From: David ‘Bombe’ Roden Date: Fri, 22 May 2009 05:10:33 +0000 (+0200) Subject: Make synchronization more consistent. X-Git-Tag: v0.1.1~53 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=d09c1e793db490ac2339b048b35bf47257a2dd56;p=jFCPlib.git Make synchronization more consistent. --- diff --git a/src/net/pterodactylus/fcp/FcpConnection.java b/src/net/pterodactylus/fcp/FcpConnection.java index a80c610..e9db700 100644 --- a/src/net/pterodactylus/fcp/FcpConnection.java +++ b/src/net/pterodactylus/fcp/FcpConnection.java @@ -359,7 +359,7 @@ public class FcpConnection implements Closeable { * The length of the stream * @return The limited input stream */ - private LimitedInputStream getInputStream(long dataLength) { + private synchronized LimitedInputStream getInputStream(long dataLength) { if (dataLength <= 0) { return new LimitedInputStream(null, 0); } @@ -482,7 +482,7 @@ public class FcpConnection implements Closeable { * @throws IOException * if an I/O error occurs */ - public void consume() throws IOException { + public synchronized void consume() throws IOException { while (remaining > 0) { skip(remaining); }