diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-04-25 14:49:13 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-04-25 14:49:13 +0400 |
commit | 3f12beb4d0440da93ccbe67c76f23a2f15452aac (patch) | |
tree | 3e3d34d0396a598abd4b40f8cc4de8d450d08d2c /source/blender/blenlib/intern/threads.c | |
parent | 6c3317612edce15095e3868e0cb3135e19eb77f2 (diff) |
Fix #22123 and #22124: some problems with mutex locks, also tweak to
how removing opengl textures from outside main thread is done so it
happens as part of the main loop.
Diffstat (limited to 'source/blender/blenlib/intern/threads.c')
-rw-r--r-- | source/blender/blenlib/intern/threads.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c index de7842727df..c6ad6592268 100644 --- a/source/blender/blenlib/intern/threads.c +++ b/source/blender/blenlib/intern/threads.c @@ -108,6 +108,7 @@ static pthread_mutex_t _preview_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t _viewer_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t _custom1_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t _rcache_lock = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t _opengl_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_t mainid; static int thread_levels= 0; /* threads can be invoked inside threads */ @@ -344,6 +345,8 @@ void BLI_lock_thread(int type) pthread_mutex_lock(&_custom1_lock); else if (type==LOCK_RCACHE) pthread_mutex_lock(&_rcache_lock); + else if (type==LOCK_OPENGL) + pthread_mutex_lock(&_opengl_lock); } void BLI_unlock_thread(int type) @@ -356,8 +359,8 @@ void BLI_unlock_thread(int type) pthread_mutex_unlock(&_viewer_lock); else if(type==LOCK_CUSTOM1) pthread_mutex_unlock(&_custom1_lock); - else if(type==LOCK_RCACHE) - pthread_mutex_unlock(&_rcache_lock); + else if(type==LOCK_OPENGL) + pthread_mutex_unlock(&_opengl_lock); } /* Mutex Locks */ |