Diff

Not logged in

Differences From Artifact [74a7fa7b2d]:

To Artifact [6cfd14d520]:


37
38
39
40
41
42
43
44


45
46
47
48
49
50
51
37
38
39
40
41
42
43

44
45
46
47
48
49
50
51
52







-
+
+







#ifdef OF_THREADS
+ (void)initialize
{
	if (self != [OFAutoreleasePool class])
		return;

	if (!of_tlskey_new(&firstKey) || !of_tlskey_new(&lastKey))
		@throw [OFInitializationFailedException newWithClass: self];
		@throw [OFInitializationFailedException
		    exceptionWithClass: self];
}
#endif

+ (void)addObject: (id)object
{
#ifdef OF_THREADS
	id lastPool = of_tlskey_get(lastKey);
62
63
64
65
66
67
68
69


70
71
72
73
74
75
76
63
64
65
66
67
68
69

70
71
72
73
74
75
76
77
78







-
+
+







#ifdef OF_THREADS
		lastPool = of_tlskey_get(lastKey);
#endif
	}

	if (lastPool == nil) {
		[object release];
		@throw [OFInitializationFailedException newWithClass: self];
		@throw [OFInitializationFailedException
		    exceptionWithClass: self];
	}

	@try {
		[lastPool _addObject: object];
	} @catch (id e) {
		[object release];
		@throw e;
93
94
95
96
97
98
99
100

101
102
103
104
105
106
107
108
109
110
111

112
113
114
115
116
117
118
95
96
97
98
99
100
101

102
103
104
105
106
107
108
109
110
111
112

113
114
115
116
117
118
119
120







-
+










-
+







	@try {
#ifdef OF_THREADS
		id firstPool = of_tlskey_get(firstKey);
		previousPool = of_tlskey_get(lastKey);

		if (!of_tlskey_set(lastKey, self))
			@throw [OFInitializationFailedException
			    newWithClass: isa];
			    exceptionWithClass: isa];
#else
		previousPool = lastPool;
		lastPool = self;
#endif

		if (firstPool == nil) {
#ifdef OF_THREADS
			if (!of_tlskey_set(firstKey, self)) {
				of_tlskey_set(lastKey, previousPool);
				@throw [OFInitializationFailedException
				    newWithClass: isa];
				    exceptionWithClass: isa];
			}
#else
			firstPool = self;
#endif
		}

		if (previousPool != nil)
205
206
207
208
209
210
211
212
213


214
215
216
217
218
219


220
221
207
208
209
210
211
212
213


214
215
216
217
218
219


220
221
222
223







-
-
+
+




-
-
+
+


#endif

	[super dealloc];
}

- retain
{
	@throw [OFNotImplementedException newWithClass: isa
					      selector: _cmd];
	@throw [OFNotImplementedException exceptionWithClass: isa
						    selector: _cmd];
}

- autorelease
{
	@throw [OFNotImplementedException newWithClass: isa
					      selector: _cmd];
	@throw [OFNotImplementedException exceptionWithClass: isa
						    selector: _cmd];
}
@end