From cf3a86b55981313e1fdfafbef89ab5ba7276a862 Mon Sep 17 00:00:00 2001 From: Svetoslav Date: Mon, 22 Sep 2014 13:48:41 -0700 Subject: [PATCH] Loosen the constraint for releasing a shared file. In the spooler we have the renderer reading a file to visualize content and the app writing a file to produce the content. Since we have to swap the file under the renderer we have a mutex file provider that both parties can request, use when released, and release when required. This enables us to request the file which closes the renderer and when the renderer is closed ask the app to write some more pages, then open the renderer, and so on. The mutex file provider was throwing of a thread that does not own the file thries to relase it which is not needed, this should be just a nop. bug:17607134 Change-Id: Id6a2ce92d70077f57978b95315648faf02c13c68 --- .../src/com/android/printspooler/model/MutexFileProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/PrintSpooler/src/com/android/printspooler/model/MutexFileProvider.java b/packages/PrintSpooler/src/com/android/printspooler/model/MutexFileProvider.java index 1f48638d8d3ea..0df5e3cf18d70 100644 --- a/packages/PrintSpooler/src/com/android/printspooler/model/MutexFileProvider.java +++ b/packages/PrintSpooler/src/com/android/printspooler/model/MutexFileProvider.java @@ -93,7 +93,7 @@ public final class MutexFileProvider { public void releaseFile() { synchronized (mLock) { if (mOwnerThread != Thread.currentThread()) { - throw new IllegalStateException("Not acquired"); + return; } if (DEBUG) {