Differences From Artifact [22a0bb4722]:
- File
src/threading_pthread.m
— part of check-in
[b4023e6bc0]
at
2016-03-28 16:50:16
on branch trunk
— Change the definition of thread priorities
The old definition was quite unpredictable and too platform-specific.
The new one defines -1.0 as lowest priority that still schedules, 0.0 as
the normal priority (meaning the same as the main thread) and +1.0 as
the highest priority that still allows getting preempted. (user: js, size: 5322) [annotate] [blame] [check-ins using]
To Artifact [e25a18277e]:
- File src/threading_pthread.m — part of check-in [9babc44b91] at 2016-04-18 14:08:21 on branch trunk — Further clean up of the threading.m split (user: js, size: 6042) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
227 228 229 230 231 232 233 234 235 236 237 238 239 240 | } bool of_mutex_free(of_mutex_t *mutex) { return (pthread_mutex_destroy(mutex) == 0); } bool of_condition_new(of_condition_t *condition) { return (pthread_cond_init(condition, NULL) == 0); } | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 227 228 229 230 231 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 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | } bool of_mutex_free(of_mutex_t *mutex) { return (pthread_mutex_destroy(mutex) == 0); } #ifdef OF_HAVE_RECURSIVE_PTHREAD_MUTEXES bool of_rmutex_new(of_rmutex_t *rmutex) { pthread_mutexattr_t attr; if (pthread_mutexattr_init(&attr) != 0) return false; if (pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE) != 0) return false; if (pthread_mutex_init(rmutex, &attr) != 0) return false; if (pthread_mutexattr_destroy(&attr) != 0) return false; return true; } bool of_rmutex_lock(of_rmutex_t *rmutex) { return of_mutex_lock(rmutex); } bool of_rmutex_trylock(of_rmutex_t *rmutex) { return of_mutex_trylock(rmutex); } bool of_rmutex_unlock(of_rmutex_t *rmutex) { return of_mutex_unlock(rmutex); } bool of_rmutex_free(of_rmutex_t *rmutex) { return of_mutex_free(rmutex); } #endif bool of_condition_new(of_condition_t *condition) { return (pthread_cond_init(condition, NULL) == 0); } |
︙ | ︙ |