Differences From Artifact [4035170a3e]:
- File
src/OFThread.m
— part of check-in
[e2b06423e0]
at
2010-09-05 23:19:08
on branch trunk
— Replace OFObject* with id in many places.
We assume now that every object understands retain, release, etc. so
that we can weaken the type from OFObject* to id. This makes it
possible to use different root object classes. (user: js, size: 5332) [annotate] [blame] [check-ins using]
To Artifact [6d911d6e5b]:
- File src/OFThread.m — part of check-in [8a7ca573c4] at 2010-10-25 23:03:22 on branch trunk — Clean up a lot of code (mostly init methods) and fix a missing rethrow. (user: js, size: 5204) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
131 132 133 134 135 136 137 | [thread release]; of_thread_exit(); } - init { | > > | > | > > > > | 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | [thread release]; of_thread_exit(); } - init { Class c = isa; [self release]; @throw [OFNotImplementedException newWithClass: c selector: _cmd]; } - initWithObject: (id)obj { self = [super init]; @try { object = [obj retain]; } @catch (id e) { [self release]; @throw e; } return self; } - (id)main { @throw [OFNotImplementedException newWithClass: isa |
︙ | ︙ | |||
225 226 227 228 229 230 231 | } } - init { self = [super init]; | > | < < | > | < | | < > | < < < < < < | | < | 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | } } - init { self = [super init]; @try { if (!of_tlskey_new(&key)) @throw [OFInitializationFailedException newWithClass: isa]; destructor = NULL; @synchronized (tlskeys) { listobj = [tlskeys appendObject: self]; } } @catch (id e) { [self release]; @throw e; } return self; } - initWithDestructor: (void(*)(id))destructor_ { |
︙ | ︙ | |||
267 268 269 270 271 272 273 | - (void)dealloc { if (destructor != NULL) destructor(self); of_tlskey_free(key); | < | | > > | | 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 | - (void)dealloc { if (destructor != NULL) destructor(self); of_tlskey_free(key); /* In case we called [self release] in init */ if (listobj != NULL) { @synchronized (tlskeys) { [tlskeys removeListObject: listobj]; } } [super dealloc]; } @end @implementation OFMutex + mutex { return [[[self alloc] init] autorelease]; } - init { self = [super init]; if (!of_mutex_new(&mutex)) { Class c = isa; [self release]; @throw [OFInitializationFailedException newWithClass: c]; } return self; } - (void)lock |
︙ | ︙ |