diff options
author | Miika Hamalainen <blender@miikah.org> | 2011-10-22 20:16:14 +0400 |
---|---|---|
committer | Miika Hamalainen <blender@miikah.org> | 2011-10-22 20:16:14 +0400 |
commit | 30cba27987362054d16b10e73ddf2601af93be68 (patch) | |
tree | d971f10db56b5d024cf5f7d6f3d48d1e3c20d698 /source/blender/blenlib/intern/threads.c | |
parent | 8be3249537e7930e0fa5adb59bc343455da309e9 (diff) |
Dynamic Paint:
* Some changes and cleanup pointed on the codereview.
Diffstat (limited to 'source/blender/blenlib/intern/threads.c')
-rw-r--r-- | source/blender/blenlib/intern/threads.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c index 097ad2bcd74..b4923169179 100644 --- a/source/blender/blenlib/intern/threads.c +++ b/source/blender/blenlib/intern/threads.c @@ -660,3 +660,17 @@ void BLI_thread_queue_nowait(ThreadQueue *queue) pthread_mutex_unlock(&queue->mutex); } +void BLI_begin_threaded_malloc(void) +{ + if(thread_levels == 0) { + MEM_set_lock_callback(BLI_lock_malloc_thread, BLI_unlock_malloc_thread); + } + thread_levels++; +} + +void BLI_end_threaded_malloc(void) +{ + thread_levels--; + if(thread_levels==0) + MEM_set_lock_callback(NULL, NULL); +}
\ No newline at end of file |