File tree Expand file tree Collapse file tree 3 files changed +6
-0
lines changed
main/java/org/mini2Dx/miniscript/core/util
test/java/org/mini2Dx/miniscript/core/util Expand file tree Collapse file tree 3 files changed +6
-0
lines changed Original file line number Diff line number Diff line change 11[1.7.1]
22- Fix interactive script running flag always being set to true. Update unit test.
3+ - Reduce lock contention when interactive script queue is empty
34
45[1.7.0]
56- Prevent game future execution by checking for script skipping in constructor
Original file line number Diff line number Diff line change @@ -37,11 +37,15 @@ public ScriptInvocation poll() {
3737 private ScriptInvocation pollInteractiveScript () {
3838 interactiveScriptLock .lockRead ();
3939 boolean scriptRunning = interactiveScriptRunning .get ();
40+ boolean queueEmpty = interactiveScriptQueue .isEmpty ();
4041 interactiveScriptLock .unlockRead ();
4142
4243 if (scriptRunning ) {
4344 return null ;
4445 }
46+ if (queueEmpty ) {
47+ return null ;
48+ }
4549
4650 ScriptInvocation result = null ;
4751 interactiveScriptLock .lockWrite ();
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ public void testOnlyOneInteractiveScriptPolled() {
4141 }
4242 if (scriptInvocation .isInteractive ()) {
4343 interactiveScriptsRunning .incrementAndGet ();
44+ Assert .assertTrue (invocationQueue .isInteractiveScriptRunnung ());
4445 }
4546 try {
4647 Thread .sleep (10 );
You can’t perform that action at this time.
0 commit comments