Skip to content

Commit 7935aa8

Browse files
boris-petrovfpapon
authored andcommitted
Mark SecurityUtils.securityManager as volatile
As it can be modified and read by different threads
1 parent 17ba694 commit 7935aa8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/java/org/apache/shiro/SecurityUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public abstract class SecurityUtils {
3434
* ONLY used as a 'backup' in VM Singleton environments (that is, standalone environments), since the
3535
* ThreadContext should always be the primary source for Subject instances when possible.
3636
*/
37-
private static SecurityManager securityManager;
37+
private static volatile SecurityManager securityManager;
3838

3939
/**
4040
* Returns the currently accessible {@code Subject} available to the calling code depending on

0 commit comments

Comments
 (0)