99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
|
+ (OFRunLoop*)mainRunLoop
{
return [[mainRunLoop retain] autorelease];
}
+ (OFRunLoop*)currentRunLoop
{
OFThread *currentThread = [OFThread currentThread];
OFRunLoop *runLoop = [currentThread runLoop];
if (runLoop != nil)
return runLoop;
runLoop = [[[OFRunLoop alloc] init] autorelease];
[currentThread OF_setRunLoop: runLoop];
return runLoop;
}
+ (void)OF_setMainRunLoop
{
void *pool = objc_autoreleasePoolPush();
mainRunLoop = [[[OFThread currentThread] runLoop] retain];
objc_autoreleasePoolPop(pool);
}
#ifdef OF_HAVE_BLOCKS
+ (void)OF_addAsyncReadForStream: (OFStream*)stream
buffer: (void*)buffer
length: (size_t)length
|
|
<
<
<
<
<
<
<
<
<
|
|
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
+ (OFRunLoop*)mainRunLoop
{
return [[mainRunLoop retain] autorelease];
}
+ (OFRunLoop*)currentRunLoop
{
return [[OFThread currentThread] runLoop];
}
+ (void)OF_setMainRunLoop
{
void *pool = objc_autoreleasePoolPush();
mainRunLoop = [[self currentRunLoop] retain];
objc_autoreleasePoolPop(pool);
}
#ifdef OF_HAVE_BLOCKS
+ (void)OF_addAsyncReadForStream: (OFStream*)stream
buffer: (void*)buffer
length: (size_t)length
|