Overview
Comment: | Resolve more FIXMEs. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
f1637e9310171519dee4852fe0996b42 |
User & Date: | js on 2009-11-13 18:53:10 |
Other Links: | manifest | tags |
Context
2009-11-13
| ||
21:02 | Fix one more FIXME. check-in: d7d45d4b69 user: js tags: trunk | |
18:53 | Resolve more FIXMEs. check-in: f1637e9310 user: js tags: trunk | |
18:42 | Add OFMutex(Lock|Unlock)FailedException and fix a few FIXMEs. check-in: 9a623a35d0 user: js tags: trunk | |
Changes
Modified src/OFExceptions.h from [dcad64c6f9] to [26a733beee].
︙ | ︙ | |||
678 679 680 681 682 683 684 | /** * An OFException indicating that joining the thread failed. */ @interface OFThreadJoinFailedException: OFException {} @end | < < < < < < | 678 679 680 681 682 683 684 685 686 687 688 689 690 691 | /** * An OFException indicating that joining the thread failed. */ @interface OFThreadJoinFailedException: OFException {} @end /** * An OFException indicating that locking a mutex failed. */ @interface OFMutexLockFailedException: OFException {} @end /** |
︙ | ︙ |
Modified src/OFExceptions.m from [5a256fa7d9] to [f159950386].
︙ | ︙ | |||
977 978 979 980 981 982 983 | if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Joining a thread of class %s failed! Most likely, another thread " @"already waits for the thread to join.", [class_ className]]; | < < < < < < < < < < < < < < < | 977 978 979 980 981 982 983 984 985 986 987 988 989 990 | if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Joining a thread of class %s failed! Most likely, another thread " @"already waits for the thread to join.", [class_ className]]; return string; } @end @implementation OFMutexLockFailedException - (OFString*)string { |
︙ | ︙ |
Modified src/OFThread.m from [40c1edc042] to [18efd35d69].
︙ | ︙ | |||
129 130 131 132 133 134 135 | return self; } - initWithDestructor: (void(*)(id))destructor { self = [super init]; | < > > > > | > | 129 130 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 | return self; } - initWithDestructor: (void(*)(id))destructor { self = [super init]; if (!of_tlskey_new(&key, destructor)) { Class c = isa; [super dealloc]; @throw [OFInitializationFailedException newWithClass: c]; } return self; } - (void)dealloc { of_tlskey_free(key); [super dealloc]; } @end @implementation OFMutex + mutex { return [[[self alloc] init] autorelease]; } |
︙ | ︙ |
Modified src/threading.h from [7b407a5ba1] to [44dc680850].
︙ | ︙ | |||
50 51 52 53 54 55 56 | { #ifndef _WIN32 void *ret; if (pthread_join(thread, &ret)) return NO; | < | 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | { #ifndef _WIN32 void *ret; if (pthread_join(thread, &ret)) return NO; return (ret != PTHREAD_CANCELED ? YES : NO); #else if (WaitForSingleObject(thread, INFINITE)) return NO; CloseHandle(thread); |
︙ | ︙ | |||
159 160 161 162 163 164 165 | #ifndef _WIN32 return (pthread_setspecific(key, p) ? NO : YES); #else return (TlsSetValue(key, p) ? YES : NO); #endif } | > > > > > > > > > > | 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | #ifndef _WIN32 return (pthread_setspecific(key, p) ? NO : YES); #else return (TlsSetValue(key, p) ? YES : NO); #endif } static OF_INLINE BOOL of_tlskey_free(of_tlskey_t key) { #ifndef _WIN32 return (pthread_key_delete(key) ? NO : YES); #else return (TlsFree(key) ? YES : NO); #endif } |