ObjFW  Diff

Differences From Artifact [1d59e36e29]:

To Artifact [3f9b8ad9ca]:


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
67
68
69
70
71
72
73
74

75
76
77
78
79
80
81
82
83
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


67


68
69
70
71
72
73
74







-
+

-
-
+
-
-




-
+
-
-
-













-
-
+
-
-







+ (void)initialize
{
	pool_list_key = [[OFTLSKey alloc] initWithDestructor: release_list];
}

+ (void)addToPool: (OFObject*)obj
{
	OFList *pool_list;
	OFList *pool_list = [OFThread objectForTLSKey: pool_list_key];

	@try {
		pool_list = [OFThread objectForTLSKey: pool_list_key];
	if (pool_list == nil || [pool_list last] == NULL) {
	} @catch (OFNotInSetException *e) {
		[e dealloc];
		[[self alloc] init];
		pool_list = [OFThread objectForTLSKey: pool_list_key];
	}

	if ([pool_list last] == NULL)
	if (pool_list == nil || [pool_list last] == NULL)
		[[self alloc] init];

	if ([pool_list last] == NULL)
		@throw [OFInitializationFailedException newWithClass: self];

	[[pool_list last]->object addToPool: obj];
}

- init
{
	OFList *pool_list;

	self = [super init];

	objects = nil;

	@try {
		pool_list = [OFThread objectForTLSKey: pool_list_key];
	if ((pool_list = [OFThread objectForTLSKey: pool_list_key]) == nil) {
	} @catch (OFNotInSetException *e) {
		[e dealloc];
		pool_list = [[OFList alloc] initWithoutRetainAndRelease];
		[OFThread setObject: pool_list
			  forTLSKey: pool_list_key];
		[pool_list release];
	}

	listobj = [pool_list append: self];