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:
Diffstat (limited to 'source/blender/windowmanager/intern/wm_jobs.c')
-rw-r--r--source/blender/windowmanager/intern/wm_jobs.c48
1 files changed, 28 insertions, 20 deletions
diff --git a/source/blender/windowmanager/intern/wm_jobs.c b/source/blender/windowmanager/intern/wm_jobs.c
index b8dfae63b4d..591ed5c33b5 100644
--- a/source/blender/windowmanager/intern/wm_jobs.c
+++ b/source/blender/windowmanager/intern/wm_jobs.c
@@ -247,33 +247,40 @@ static void wm_jobs_test_suspend_stop(wmWindowManager *wm, wmJob *test)
wmJob *steve;
int suspend= 0;
- for(steve= wm->jobs.first; steve; steve= steve->next) {
- /* obvious case, no test needed */
- if(steve==test || !steve->running) continue;
-
- /* if new job is not render, then check for same startjob */
- if(0==(test->flag & WM_JOB_EXCL_RENDER))
- if(steve->startjob!=test->startjob)
- continue;
-
- /* if new job is render, any render job should be stopped */
- if(test->flag & WM_JOB_EXCL_RENDER)
- if(0==(steve->flag & WM_JOB_EXCL_RENDER))
- continue;
-
+ /* job added with suspend flag, we wait 1 timer step before activating it */
+ if(test->flag & WM_JOB_SUSPEND) {
suspend= 1;
+ test->flag &= ~WM_JOB_SUSPEND;
+ }
+ else {
+ /* check other jobs */
+ for(steve= wm->jobs.first; steve; steve= steve->next) {
+ /* obvious case, no test needed */
+ if(steve==test || !steve->running) continue;
+
+ /* if new job is not render, then check for same startjob */
+ if(0==(test->flag & WM_JOB_EXCL_RENDER))
+ if(steve->startjob!=test->startjob)
+ continue;
+
+ /* if new job is render, any render job should be stopped */
+ if(test->flag & WM_JOB_EXCL_RENDER)
+ if(0==(steve->flag & WM_JOB_EXCL_RENDER))
+ continue;
- /* if this job has higher priority, stop others */
- if(test->flag & WM_JOB_PRIORITY) {
- steve->stop= 1;
- // printf("job stopped: %s\n", steve->name);
+ suspend= 1;
+
+ /* if this job has higher priority, stop others */
+ if(test->flag & WM_JOB_PRIORITY) {
+ steve->stop= 1;
+ // printf("job stopped: %s\n", steve->name);
+ }
}
}
-
+
/* possible suspend ourselfs, waiting for other jobs, or de-suspend */
test->suspended= suspend;
// if(suspend) printf("job suspended: %s\n", test->name);
-
}
/* if job running, the same owner gave it a new job */
@@ -286,6 +293,7 @@ void WM_jobs_start(wmWindowManager *wm, wmJob *steve)
// printf("job started a running job, ending... %s\n", steve->name);
}
else {
+
if(steve->customdata && steve->startjob) {
wm_jobs_test_suspend_stop(wm, steve);