diff options
author | Miika Hamalainen <blender@miikah.org> | 2011-11-10 14:24:34 +0400 |
---|---|---|
committer | Miika Hamalainen <blender@miikah.org> | 2011-11-10 14:24:34 +0400 |
commit | afeb0eeaf0e8caf5e46a5dd6fbea3786e9fb1354 (patch) | |
tree | 36ab74ff3fa36d27c0f35527d3b55e68e3d27fe5 /source/blender/blenlib/intern/threads.c | |
parent | 1e035381d10068eb17345a88d42cebc0d579adf3 (diff) | |
parent | 1b4a54ad73c058baa59ffdc9e5f18b0b79030fb0 (diff) |
Dynamic Paint merge:
Commit Dynamic Paint from "soc-2011-carrot" branch into trunk.
End-user documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Modifiers/Simulation/Dynamic_Paint
GSoC wiki page:
http://wiki.blender.org/index.php/User:MiikaH/GSoC-2011-DynamicPaint
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 8247b861a7a..38b3fe669b6 100644 --- a/source/blender/blenlib/intern/threads.c +++ b/source/blender/blenlib/intern/threads.c @@ -669,3 +669,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 |