Fix #35960, #36044: blender internal viewport rendering crash while editing data.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 8 Jul 2013 17:56:51 +0000 (17:56 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 8 Jul 2013 17:56:51 +0000 (17:56 +0000)
commit3ce280e825cdd7bcbdd58cb10537a2aa11119ee3
tree54328823ffa9f00932a98d21e2aa89c37584e530
parent861f9e10f7ea9d1d38130ecbc983fe8f8dac93d0
Fix #35960, #36044: blender internal viewport rendering crash while editing data.
Now the viewport rendering thread will lock the main thread while it is exporting
objects to render data. This is not ideal if you have big scenes that might block
the UI, but Cycles does the same, and it's fairly quick because the same evaluated
mesh can be used as for viewport drawing. It's the only way to get things stable
until the thread safe dependency graph is here.

This adds a mechanism to the job system for jobs to lock the main thread, using a
new 'ticket mutex lock' which is a mutex lock that gives priority to the first
thread that tries to lock the mutex.

Still to solve: undo/redo crashes.
source/blender/blenlib/BLI_threads.h
source/blender/blenlib/intern/threads.c
source/blender/editors/render/render_internal.c
source/blender/render/extern/include/RE_pipeline.h
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/pipeline.c
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/intern/wm_jobs.c