diff options
Diffstat (limited to 'source/blender/blenlib/intern/threads.c')
-rw-r--r-- | source/blender/blenlib/intern/threads.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c index 146e1d531f1..a74f82ae965 100644 --- a/source/blender/blenlib/intern/threads.c +++ b/source/blender/blenlib/intern/threads.c @@ -429,12 +429,16 @@ void BLI_spin_unlock(SpinLock *spin) #endif } +#ifndef __APPLE__ void BLI_spin_end(SpinLock *spin) { -#ifndef __APPLE__ pthread_spin_destroy(spin); -#endif } +#else +void BLI_spin_end(SpinLock *UNUSED(spin)) +{ +} +#endif /* Read/Write Mutex Lock */ @@ -729,6 +733,9 @@ void BLI_thread_queue_wait_finish(ThreadQueue *queue) void BLI_begin_threaded_malloc(void) { + /* Used for debug only */ + /* BLI_assert(thread_levels >= 0); */ + if (thread_levels == 0) { MEM_set_lock_callback(BLI_lock_malloc_thread, BLI_unlock_malloc_thread); } @@ -737,6 +744,9 @@ void BLI_begin_threaded_malloc(void) void BLI_end_threaded_malloc(void) { + /* Used for debug only */ + /* BLI_assert(thread_levels >= 0); */ + thread_levels--; if (thread_levels == 0) MEM_set_lock_callback(NULL, NULL); |