Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

readme update

  • Loading branch information...
commit e5a73ddce29c2f6264920d4df851f1ff8d6acf5d 1 parent d569a2c
@stevedekorte authored
View
6 ActorKit/NSInvocation+Copy.m
@@ -14,15 +14,11 @@ @implementation NSInvocation (NSInvocation_Copy)
- (id)copy
{
NSInvocation *copy = [NSInvocation invocationWithMethodSignature:[self methodSignature]];
- //[copy setTarget:[self target]];
- //[copy setSelector:[self selector]];
-
- char buffer[sizeof(intmax_t)];
-
NSUInteger argCount = [[self methodSignature] numberOfArguments];
for (int i = 0; i < argCount; i++)
{
+ char buffer[sizeof(intmax_t)];
[self getArgument:(void *)&buffer atIndex:i];
[copy setArgument:(void *)&buffer atIndex:i];
}
View
10 ActorKit/ThreadSafeProxy.h
@@ -9,15 +9,15 @@
@interface ThreadSafeProxy : NSProxy
{
- id syncProxyTarget;
- NSLock *syncProxyLock;
+ id threadSafeProxyTarget;
+ NSLock *threadSafeProxyLock;
}
// all private
-@property (retain, atomic) id syncProxyTarget;
-@property (retain, atomic) NSLock *syncProxyLock;
+@property (retain, atomic) id threadSafeProxyTarget;
+@property (retain, atomic) NSLock *threadSafeProxyLock;
-- (void)setProxyTarget:anObject;
+- (void)setThreadSafeProxyTarget:anObject;
@end
View
16 ActorKit/ThreadSafeProxy.m
@@ -11,8 +11,8 @@
@implementation ThreadSafeProxy
-@synthesize syncProxyTarget;
-@synthesize syncProxyLock;
+@synthesize threadSafeProxyTarget;
+@synthesize threadSafeProxyLock;
- init
{
@@ -30,12 +30,12 @@ - (void)dealloc
- (void)setProxyTarget:anObject
{
[self setThreadSafeProxyTarget:anObject];
- [syncProxyLock setName:[syncProxyTarget description]];
+ [threadSafeProxyLock setName:[threadSafeProxyTarget description]];
}
- (BOOL)respondsToSelector:(SEL)aSelector
{
- return [syncProxyTarget respondsToSelector:aSelector];
+ return [threadSafeProxyLock respondsToSelector:aSelector];
}
- (void)forwardInvocation:(NSInvocation *)anInvocation
@@ -43,14 +43,14 @@ - (void)forwardInvocation:(NSInvocation *)anInvocation
// probably could have used @synchronized() {}
// but access to the lock object might be useful later
- [syncProxyLock lock];
- [anInvocation invokeWithTarget:syncProxyTarget];
- [syncProxyLock unlock];
+ [threadSafeProxyLock lock];
+ [anInvocation invokeWithTarget:threadSafeProxyTarget];
+ [threadSafeProxyLock unlock];
}
- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector
{
- return [syncProxyTarget methodSignatureForSelector:aSelector];
+ return [threadSafeProxyTarget methodSignatureForSelector:aSelector];
}
@end
View
10 README.txt
@@ -12,15 +12,16 @@ ActorProxy
Sending messages to the actor will queue them to be processed in first-in-first-out order
by the actor's thread and immediately returns a "future" object.
- When it's message queue reaches that limit (settable with setActorQueueLimit:),
- calling threads will be paused.
+ If it's message queue exceeds a given limit (set with setActorQueueLimit:),
+ the calling threads that exceeded the limit will be paused until the more
+ of the queue is processed.
FutureProxy
A future is a transparent proxy for the result which, when accessed before the
- result is ready, will pauses calling threads until it is ready.
+ result is ready, pauses any threads attempting to access it until it is ready.
Futures auto detect and raise an exception in deadlock situations.
@@ -32,7 +33,8 @@ FutureProxy
// ... do stuff ...
- // now when we try to access the values, the thread waits if the values aren't ready
+ // now when we try to access the values,
+ // the thread waits if the values aren't ready
NSLog(@"request returned %i bytes", (int)[aFuture length]);
Please sign in to comment.
Something went wrong with that request. Please try again.