From 499a70091be28305cd3a3b791880759361ce04fe Mon Sep 17 00:00:00 2001 From: wcrisman Date: Thu, 17 Jul 2014 12:19:22 -0700 Subject: [PATCH] A hail mary to fix the deadlocking of request/responses in https over the internet (slow connections). Not sure if this will work at all. Tried to fix the null target exception (very strange since it should be possible) in the ThreadService. --- Common/src/com/common/thread/ThreadService.java | 5 ++--- .../src/com/foundation/web/server/WebServer.java | 8 +++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Common/src/com/common/thread/ThreadService.java b/Common/src/com/common/thread/ThreadService.java index 9132633..498169e 100644 --- a/Common/src/com/common/thread/ThreadService.java +++ b/Common/src/com/common/thread/ThreadService.java @@ -146,7 +146,7 @@ public class ThreadService { //Wait until the thread is told to run again// try { //Make sure we don't have a target.// - if(getTarget() == null) { + if((target = getTarget()) == null) { //Wait for the next run of this thread// wait(); }//if// @@ -154,8 +154,7 @@ public class ThreadService { catch(InterruptedException e) { return; }//catch// - - target = getTarget(); + setTarget(null); }//synchronized// diff --git a/Foundation Web Core/src/com/foundation/web/server/WebServer.java b/Foundation Web Core/src/com/foundation/web/server/WebServer.java index 576da51..084bc38 100644 --- a/Foundation Web Core/src/com/foundation/web/server/WebServer.java +++ b/Foundation Web Core/src/com/foundation/web/server/WebServer.java @@ -2074,10 +2074,12 @@ public class WebServer { if(activeThreadCount-- != maxThreadCount) { loop = false; - if(requiresWakeup) { - selector.wakeup(); - }//if// +// if(requiresWakeup) { +// selector.wakeup(); +// }//if// }//if// + + selector.wakeup(); }//synchronized// }//finally// }//else if//