Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiika Hamalainen <blender@miikah.org>2011-10-22 20:16:14 +0400
committerMiika Hamalainen <blender@miikah.org>2011-10-22 20:16:14 +0400
commit30cba27987362054d16b10e73ddf2601af93be68 (patch)
treed971f10db56b5d024cf5f7d6f3d48d1e3c20d698 /source/blender/blenlib/intern/threads.c
parent8be3249537e7930e0fa5adb59bc343455da309e9 (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.c14
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