Commit 5887514
committed
[Win32] Ensure and document thread-safety of SWTFontProvider
The SWTFontProvider is Win32-internal for accessing font registries that
manage the fonts for a device at different zoom levels. Currently, this
class does not consider it's accesses' thread-safety.
This change makes the SWTFontProvider thread-safe under current usage
contexts:
- Make the internal map thread-safe as it may be modified from different
threads (used for the different devices/displays) concurrently. Using a
ConcurrentHashMap ensures that read access stays fast. Write access only
happens once per device creation.
- Document non-thread-safety of the provider's operations and the
necessity to always call it from the same thread for the same device.
All current callers fulfill this requirement, thus no race conditions
may occur.1 parent 866aa68 commit 5887514
File tree
1 file changed
+28
-1
lines changed- bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal
1 file changed
+28
-1
lines changedLines changed: 28 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | | - | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
35 | 45 | | |
36 | 46 | | |
37 | 47 | | |
38 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
39 | 60 | | |
40 | 61 | | |
41 | 62 | | |
42 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
43 | 70 | | |
44 | 71 | | |
45 | 72 | | |
| |||
0 commit comments