Differences From Artifact [c381d0d5f6]:
- File src/exceptions/OFException.m — part of check-in [374e1a1bfa] at 2021-01-02 22:04:26 on branch trunk — Update copyright (user: js, size: 7467) [annotate] [blame] [check-ins using] [more...]
To Artifact [7a4b36018b]:
- File
src/exceptions/OFException.m
— part of check-in
[dfd52d5220]
at
2021-04-17 16:24:13
on branch new-naming-convention
— of_mutex_t -> OFPlainMutex
Also rename of_rmutex_t -> OFPlainRecursiveMutex. (user: js, size: 7481) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
65 66 67 68 69 70 71 | extern uintptr_t _Unwind_GetIP(struct _Unwind_Context *); #else extern int _Unwind_VRS_Get(struct _Unwind_Context *, int, uint32_t, int, void *); #endif #if !defined(HAVE_STRERROR_R) && defined(OF_HAVE_THREADS) | | | | | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | extern uintptr_t _Unwind_GetIP(struct _Unwind_Context *); #else extern int _Unwind_VRS_Get(struct _Unwind_Context *, int, uint32_t, int, void *); #endif #if !defined(HAVE_STRERROR_R) && defined(OF_HAVE_THREADS) static OFPlainMutex mutex; OF_CONSTRUCTOR() { OF_ENSURE(OFPlainMutexNew(&mutex) == 0); } OF_DESTRUCTOR() { OFPlainMutexFree(&mutex); } #endif OFString * of_strerror(int errNo) { OFString *ret; |
︙ | ︙ | |||
187 188 189 190 191 192 193 | if (strerror_r(errNo, buffer, 256) != 0) return @"Unknown error (strerror_r failed)"; ret = [OFString stringWithCString: buffer encoding: [OFLocale encoding]]; #else # ifdef OF_HAVE_THREADS | | | | 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | if (strerror_r(errNo, buffer, 256) != 0) return @"Unknown error (strerror_r failed)"; ret = [OFString stringWithCString: buffer encoding: [OFLocale encoding]]; #else # ifdef OF_HAVE_THREADS if (OFPlainMutexLock(&mutex) != 0) @throw [OFLockFailedException exception]; @try { # endif ret = [OFString stringWithCString: strerror(errNo) encoding: [OFLocale encoding]]; # ifdef OF_HAVE_THREADS } @finally { if (OFPlainMutexUnlock(&mutex) != 0) @throw [OFUnlockFailedException exception]; } # endif #endif return ret; } |
︙ | ︙ |