Changeset 85
- Timestamp:
- 12/27/05 17:24:53 (3 years ago)
- Files:
-
- trunk/Libs/SSHAgent.h (modified) (1 diff)
- trunk/Libs/SSHAgent.m (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Libs/SSHAgent.h
r83 r85 11 11 NSArray *keysOnAgent; 12 12 13 /* Locks */ 14 NSLock *socketPathLock; 15 NSLock *agentSocketPathLock; 16 NSLock *keysOnAgentLock; 17 NSLock *thePIDLock; 13 NSLock *agentLock; 18 14 } 19 15 trunk/Libs/SSHAgent.m
r84 r85 52 52 selector:@selector(keysOnAgentStatusChange:) name:@"KeysOnAgentUnknown" object:nil]; 53 53 54 socketPathLock = [[NSLock alloc] init]; 55 agentSocketPathLock = [[NSLock alloc] init]; 56 keysOnAgentLock = [[NSLock alloc] init]; 57 thePIDLock = [[NSLock alloc] init]; 54 agentLock = [[NSLock alloc] init]; 58 55 59 56 return self; … … 64 61 currentAgent = nil; 65 62 66 [socketPathLock dealloc]; 67 [agentSocketPathLock dealloc]; 68 [keysOnAgentLock dealloc]; 69 [thePIDLock dealloc]; 63 [agentLock release]; 70 64 71 65 [super dealloc]; … … 81 75 } 82 76 83 [ socketPathLock lock];77 [agentLock lock]; 84 78 NSString *oldPath = socketPath; 85 79 socketPath = [path copy]; 86 80 [oldPath release]; 87 [ socketPathLock unlock];81 [agentLock unlock]; 88 82 } 89 83 … … 91 85 - (NSString *)socketPath 92 86 { 93 [ socketPathLock lock];87 [agentLock lock]; 94 88 NSString *returnString = [[socketPath copy] autorelease]; 95 [ socketPathLock unlock];89 [agentLock unlock]; 96 90 97 91 return returnString; … … 101 95 - (void)setAgentSocketPath:(NSString *)path 102 96 { 103 [agent SocketPathLock lock];97 [agentLock lock]; 104 98 NSString *oldPath = agentSocketPath; 105 99 agentSocketPath = [path copy]; 106 100 [oldPath release]; 107 [agent SocketPathLock unlock];101 [agentLock unlock]; 108 102 } 109 103 … … 111 105 - (NSString *)agentSocketPath 112 106 { 113 [agent SocketPathLock lock];107 [agentLock lock]; 114 108 NSString *returnString = [[agentSocketPath copy] autorelease]; 115 [agent SocketPathLock unlock];109 [agentLock unlock]; 116 110 117 111 return returnString; … … 128 122 - (int)PID 129 123 { 130 [ thePIDLock lock];124 [agentLock lock]; 131 125 int returnInt = thePID; 132 [ thePIDLock unlock];126 [agentLock unlock]; 133 127 134 128 return returnInt; … … 137 131 - (void) setPID:(int)pid 138 132 { 139 [ thePIDLock lock];133 [agentLock lock]; 140 134 thePID = pid; 141 [ thePIDLock unlock];135 [agentLock unlock]; 142 136 } 143 137 … … 145 139 - (NSArray *)keysOnAgent 146 140 { 147 [ keysOnAgentLock lock];141 [agentLock lock]; 148 142 NSArray *returnArray = [[keysOnAgent copy] autorelease]; 149 [ keysOnAgentLock unlock];143 [agentLock unlock]; 150 144 151 145 return returnArray; … … 154 148 - (void) setKeysOnAgent:(NSArray *)keys 155 149 { 156 [ keysOnAgentLock lock];150 [agentLock lock]; 157 151 NSArray *oldKeys = keysOnAgent; 158 152 keysOnAgent = [keys copy]; 159 153 [oldKeys release]; 160 [ keysOnAgentLock unlock];154 [agentLock unlock]; 161 155 } 162 156
