Commit 9f51abb
committed
SLING-12519 - Use AtomicReference in ScriptableBase.java for lazy initialization of NativeJavaObject
* Introduce a special NULL_OBJECT placeholder as an intermediate state to avoid
repeated construction of NativeJavaObject in each compareAndSet(...) operation,
preventing redundant wrapper creation during concurrent access without introducing
blocking or contention.1 parent c4fac55 commit 9f51abb
File tree
1 file changed
+12
-4
lines changed- src/main/java/org/apache/sling/scripting/javascript/wrapper
1 file changed
+12
-4
lines changedLines changed: 12 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
34 | | - | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
39 | | - | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
50 | 54 | | |
51 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
52 | 61 | | |
53 | | - | |
54 | 62 | | |
55 | 63 | | |
56 | 64 | | |
| |||
0 commit comments