/
ThreadLocals.java
66 lines (54 loc) · 1.8 KB
/
ThreadLocals.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package nallar.tickthreading.global;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import nallar.tickthreading.util.BooleanThreadLocal;
@SuppressWarnings ("UnusedDeclaration")
public class ThreadLocals {
public static final ThreadLocal redPowerBlockUpdateSet = new HashSetThreadLocal();
public static final ThreadLocal redPowerPowerSearch = new LinkedListThreadLocal();
public static final ThreadLocal redPowerPowerSearchTest = new HashSetThreadLocal();
public static final BooleanThreadLocal redPowerIsSearching = new BooleanThreadLocal();
public static final ThreadLocal eligibleChunksForSpawning = new HashMapThreadLocal();
public static final ThreadLocal factorizationFindLightAirParentToVisit = new HashSetThreadLocal();
public static final ThreadLocal mapChunkTempByteArray = new MapChunkTempByteArrayThreadLocal();
private static class ArrayListThreadLocal extends ThreadLocal {
ArrayListThreadLocal() {
}
@Override
protected Object initialValue() {
return new ArrayList();
}
}
private static class HashMapThreadLocal extends ThreadLocal {
HashMapThreadLocal() {
}
@Override
protected Object initialValue() {
return new HashMap();
}
}
private static class HashSetThreadLocal extends ThreadLocal {
HashSetThreadLocal() {
}
@Override
protected Object initialValue() {
return new HashSet();
}
}
private static class LinkedListThreadLocal extends ThreadLocal {
LinkedListThreadLocal() {
}
@Override
protected Object initialValue() {
return new LinkedList();
}
}
public static class MapChunkTempByteArrayThreadLocal extends ThreadLocal<byte[]> {
@Override
public byte[] initialValue() {
return new byte[196864];
}
}
}