diff options
author | Ton Roosendaal <ton@blender.org> | 2006-02-11 18:55:00 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-02-11 18:55:00 +0300 |
commit | f4e491e2f462618b039d31e0d39f2c0f37be1b17 (patch) | |
tree | c6cef3c018bfbc5bf0879f5502c7699ea2b5d4fc /source/blender/blenlib/BLI_threads.h | |
parent | 05166d0a35d99a7731a70710a893818708d029d1 (diff) |
Thread rendering stability commit.
I noticed still several cases where the Imbuf library was called within a
thread... and that whilst the Imbuf itself isn't threadsafe. Also the
thread lock I added in rendering for loading images actually didn't
work, because then it was still possible both threads were accessing the
MEM_malloc function at same time.
This commit nearly fully replaces ImBuf calls in compositor (giving another
nice speedup btw, the way preview images in Nodes were calculated used
clumsy imbuf scaling code).
I've also centralized the 'mutex' locking for threading, which now only
resides in BLI_threads.h. This is used to secure the last ImBuf calls
I cannot replace, which is loading images and creating mipmaps.
Really hope we get something more stable now!
Diffstat (limited to 'source/blender/blenlib/BLI_threads.h')
-rw-r--r-- | source/blender/blenlib/BLI_threads.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenlib/BLI_threads.h b/source/blender/blenlib/BLI_threads.h index a9927fa08ef..3791d92d6fc 100644 --- a/source/blender/blenlib/BLI_threads.h +++ b/source/blender/blenlib/BLI_threads.h @@ -38,7 +38,10 @@ int BLI_available_thread_index(ListBase *threadbase); void BLI_insert_thread (ListBase *threadbase, void *callerdata); void BLI_remove_thread (ListBase *threadbase, void *callerdata); void BLI_end_threads (ListBase *threadbase); - + +void BLI_lock_thread (void); +void BLI_unlock_thread (void); + /* threadsafe version of MEM_malloc and friends */ void *MEM_mallocT(int len, char *name); void *MEM_callocT(int len, char *name); |