From 9b2e3ef3c85df567e6369734e9e4445bdae2b28a Mon Sep 17 00:00:00 2001 From: hmsck Date: Tue, 3 Mar 2020 16:40:21 +0100 Subject: [PATCH] Fix type system unclocking TypeSystem.unlock() should be at the same level as TypeSystem.lock(), otherwise a deadlock can occur. --- .../gosu/parser/GosuBaseAttributedFeatureInfo.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gosu-core/src/main/java/gw/internal/gosu/parser/GosuBaseAttributedFeatureInfo.java b/gosu-core/src/main/java/gw/internal/gosu/parser/GosuBaseAttributedFeatureInfo.java index e21e15897..8ee67ae75 100644 --- a/gosu-core/src/main/java/gw/internal/gosu/parser/GosuBaseAttributedFeatureInfo.java +++ b/gosu-core/src/main/java/gw/internal/gosu/parser/GosuBaseAttributedFeatureInfo.java @@ -43,9 +43,9 @@ private void maybeInitAnnotations() if( _declaredAnnotations == null ) { TypeSystem.lock(); - if( _declaredAnnotations == null ) - { - try { + try { + if( _declaredAnnotations == null ) + { List rawAnnotations = getGosuAnnotations(); if (rawAnnotations != null) { ArrayList lst = new ArrayList(); @@ -59,10 +59,10 @@ private void maybeInitAnnotations() _declaredAnnotations = Collections.emptyList(); } } - finally - { - TypeSystem.unlock(); - } + } + finally + { + TypeSystem.unlock(); } } }