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
|
}
+ (void)addToPool: (OFObject*)obj
{
OFList *pool_list = [OFThread objectForTLSKey: pool_list_key];
if (pool_list == nil || [pool_list last] == NULL) {
[[self alloc] init];
pool_list = [OFThread objectForTLSKey: pool_list_key];
}
if (pool_list == nil || [pool_list last] == NULL)
@throw [OFInitializationFailedException newWithClass: self];
[[pool_list last]->object addToPool: obj];
}
- init
{
OFList *pool_list;
self = [super init];
if ((pool_list = [OFThread objectForTLSKey: pool_list_key]) == nil) {
pool_list = [[OFList alloc] initWithoutRetainAndRelease];
[OFThread setObject: pool_list
forTLSKey: pool_list_key];
[pool_list release];
}
listobj = [pool_list append: self];
return self;
}
- (void)dealloc
{
/*
|
>
|
|
>
>
>
|
|
>
|
>
|
>
>
|
>
>
>
>
>
|
>
>
>
>
>
>
>
|
|
>
>
>
>
|
|
|
>
>
|
>
>
>
>
|
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
}
+ (void)addToPool: (OFObject*)obj
{
OFList *pool_list = [OFThread objectForTLSKey: pool_list_key];
if (pool_list == nil || [pool_list last] == NULL) {
@try {
[[self alloc] init];
pool_list = [OFThread objectForTLSKey: pool_list_key];
} @catch (OFException *e) {
[obj release];
@throw e;
}
}
if (pool_list == nil || [pool_list last] == NULL) {
[obj release];
@throw [OFInitializationFailedException newWithClass: self];
}
@try {
[[pool_list last]->object addToPool: obj];
} @catch (OFException *e) {
[obj release];
@throw e;
}
}
- init
{
OFList *pool_list;
self = [super init];
if ((pool_list = [OFThread objectForTLSKey: pool_list_key]) == nil) {
@try {
pool_list = [[OFList alloc]
initWithoutRetainAndRelease];
} @catch (OFException *e) {
[self dealloc];
@throw e;
}
@try {
[OFThread setObject: pool_list
forTLSKey: pool_list_key];
} @catch (OFException *e) {
[self dealloc];
@throw e;
} @finally {
[pool_list release];
}
}
@try {
listobj = [pool_list append: self];
} @catch (OFException *e) {
[self dealloc];
@throw e;
}
return self;
}
- (void)dealloc
{
/*
|