Skip to content

Commit b4fabe5

Browse files
amartya4256fedejeanne
authored andcommitted
Make DPIZoomChangeHandlers concurrent R/W able #62
This commit changes the type of DPIZoomChangeRegistry::dpiZoomChangeHandlers from TreeMap to ConcurrentSkipListMap as at times there can be classes which can register their handlers amidst a DPI change event leading to concurrent read and write which can lead to ConcurrentModificationException contributes to #62 and #127
1 parent 9a9cf31 commit b4fabe5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/DPIZoomChangeRegistry.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@
1515

1616
import java.util.*;
1717
import java.util.Map.*;
18+
import java.util.concurrent.*;
1819

1920
import org.eclipse.swt.*;
2021
import org.eclipse.swt.widgets.*;
2122

2223
public class DPIZoomChangeRegistry {
2324

24-
private static Map<Class<? extends Widget>, DPIZoomChangeHandler> dpiZoomChangeHandlers = new TreeMap<>(
25+
private static Map<Class<? extends Widget>, DPIZoomChangeHandler> dpiZoomChangeHandlers = new ConcurrentSkipListMap<>(
2526
(o1, o2) -> {
2627
if(o1.isAssignableFrom(o2)) {
2728
return -1;

0 commit comments

Comments
 (0)