diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-02-15 17:17:43 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-02-15 17:17:43 +0300 |
commit | ca5fdd857b7864b0336aca655f2c04d00090c0f9 (patch) | |
tree | 5e19a8ec6a5c08ba9d6e8cf1f98cd7d9980a5f23 /source/blender/blenkernel | |
parent | df1c88b652e6977491b7f2b019c326518ccdc320 (diff) | |
parent | 2aef87bfae4a6a91f626780767aab68b7791c9d4 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/dynamicpaint.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 16 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/movieclip.c | 20 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/ocean.c | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/smoke.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/softbody.c | 12 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/tracking_util.c | 4 |
7 files changed, 34 insertions, 34 deletions
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index 2591c3c3c47..349f995819c 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -4555,7 +4555,7 @@ static int dynamicPaint_paintParticles(DynamicPaintSurface *surface, } /* begin thread safe malloc */ - BLI_begin_threaded_malloc(); + BLI_threaded_malloc_begin(); /* only continue if particle bb is close enough to canvas bb */ if (boundsIntersectDist(&grid->grid_bounds, &part_bb, range)) { @@ -4590,7 +4590,7 @@ static int dynamicPaint_paintParticles(DynamicPaintSurface *surface, &settings); } } - BLI_end_threaded_malloc(); + BLI_threaded_malloc_end(); BLI_kdtree_free(tree); return 1; diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index d720dc41abf..d38987c942f 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -2548,7 +2548,7 @@ void BKE_image_verify_viewer_views(const RenderData *rd, Image *ima, ImageUser * bool do_reset; const bool is_multiview = (rd->scemode & R_MULTIVIEW) != 0; - BLI_lock_thread(LOCK_DRAW_IMAGE); + BLI_thread_lock(LOCK_DRAW_IMAGE); if (!BKE_scene_multiview_is_stereo3d(rd)) iuser->flag &= ~IMA_SHOW_STEREO; @@ -2582,7 +2582,7 @@ void BKE_image_verify_viewer_views(const RenderData *rd, Image *ima, ImageUser * BLI_spin_unlock(&image_spin); } - BLI_unlock_thread(LOCK_DRAW_IMAGE); + BLI_thread_unlock(LOCK_DRAW_IMAGE); } void BKE_image_walk_all_users(const Main *mainp, void *customdata, @@ -3663,7 +3663,7 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **r_loc /* release is done in BKE_image_release_ibuf using r_lock */ if (from_render) { - BLI_lock_thread(LOCK_VIEWER); + BLI_thread_lock(LOCK_VIEWER); *r_lock = re; rv = NULL; } @@ -3756,7 +3756,7 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **r_loc } /* invalidate color managed buffers if render result changed */ - BLI_lock_thread(LOCK_COLORMANAGE); + BLI_thread_lock(LOCK_COLORMANAGE); if (ibuf->x != rres.rectx || ibuf->y != rres.recty || ibuf->rect_float != rectf) { ibuf->userflags |= IB_DISPLAY_BUFFER_INVALID; } @@ -3797,7 +3797,7 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **r_loc ibuf->flags &= ~IB_zbuffloat; } - BLI_unlock_thread(LOCK_COLORMANAGE); + BLI_thread_unlock(LOCK_COLORMANAGE); ibuf->dither = dither; @@ -3999,7 +3999,7 @@ static ImBuf *image_acquire_ibuf(Image *ima, ImageUser *iuser, void **r_lock) /* requires lock/unlock, otherwise don't return image */ if (r_lock) { /* unlock in BKE_image_release_ibuf */ - BLI_lock_thread(LOCK_VIEWER); + BLI_thread_lock(LOCK_VIEWER); *r_lock = ima; /* XXX anim play for viewer nodes not yet supported */ @@ -4052,11 +4052,11 @@ void BKE_image_release_ibuf(Image *ima, ImBuf *ibuf, void *lock) if (lock) { /* for getting image during threaded render / compositing, need to release */ if (lock == ima) { - BLI_unlock_thread(LOCK_VIEWER); /* viewer image */ + BLI_thread_unlock(LOCK_VIEWER); /* viewer image */ } else if (lock) { RE_ReleaseResultImage(lock); /* render result */ - BLI_unlock_thread(LOCK_VIEWER); /* view image imbuf */ + BLI_thread_unlock(LOCK_VIEWER); /* view image imbuf */ } } diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c index 08df976941b..a416de07c6d 100644 --- a/source/blender/blenkernel/intern/movieclip.c +++ b/source/blender/blenkernel/intern/movieclip.c @@ -926,7 +926,7 @@ static ImBuf *movieclip_get_postprocessed_ibuf(MovieClip *clip, /* cache isn't threadsafe itself and also loading of movies * can't happen from concurrent threads that's why we use lock here */ - BLI_lock_thread(LOCK_MOVIECLIP); + BLI_thread_lock(LOCK_MOVIECLIP); /* try to obtain cached postprocessed frame first */ if (need_postprocessed_frame(user, postprocess_flag)) { @@ -976,7 +976,7 @@ static ImBuf *movieclip_get_postprocessed_ibuf(MovieClip *clip, } } - BLI_unlock_thread(LOCK_MOVIECLIP); + BLI_thread_unlock(LOCK_MOVIECLIP); return ibuf; } @@ -1410,13 +1410,13 @@ static void movieclip_build_proxy_ibuf(MovieClip *clip, ImBuf *ibuf, int cfra, i * could be solved in a way that thread only prepares memory * buffer and write to disk happens separately */ - BLI_lock_thread(LOCK_MOVIECLIP); + BLI_thread_lock(LOCK_MOVIECLIP); BLI_make_existing_file(name); if (IMB_saveiff(scaleibuf, name, IB_rect) == 0) perror(name); - BLI_unlock_thread(LOCK_MOVIECLIP); + BLI_thread_unlock(LOCK_MOVIECLIP); IMB_freeImBuf(scaleibuf); } @@ -1560,9 +1560,9 @@ ImBuf *BKE_movieclip_anim_ibuf_for_frame(MovieClip *clip, MovieClipUser *user) ImBuf *ibuf = NULL; if (clip->source == MCLIP_SRC_MOVIE) { - BLI_lock_thread(LOCK_MOVIECLIP); + BLI_thread_lock(LOCK_MOVIECLIP); ibuf = movieclip_load_movie_file(clip, user, user->framenr, clip->flag); - BLI_unlock_thread(LOCK_MOVIECLIP); + BLI_thread_unlock(LOCK_MOVIECLIP); } return ibuf; @@ -1572,9 +1572,9 @@ bool BKE_movieclip_has_cached_frame(MovieClip *clip, MovieClipUser *user) { bool has_frame = false; - BLI_lock_thread(LOCK_MOVIECLIP); + BLI_thread_lock(LOCK_MOVIECLIP); has_frame = has_imbuf_cache(clip, user, clip->flag); - BLI_unlock_thread(LOCK_MOVIECLIP); + BLI_thread_unlock(LOCK_MOVIECLIP); return has_frame; } @@ -1585,9 +1585,9 @@ bool BKE_movieclip_put_frame_if_possible(MovieClip *clip, { bool result; - BLI_lock_thread(LOCK_MOVIECLIP); + BLI_thread_lock(LOCK_MOVIECLIP); result = put_imbuf_cache(clip, user, ibuf, clip->flag, false); - BLI_unlock_thread(LOCK_MOVIECLIP); + BLI_thread_unlock(LOCK_MOVIECLIP); return result; } diff --git a/source/blender/blenkernel/intern/ocean.c b/source/blender/blenkernel/intern/ocean.c index 0b4bc39627e..2d8527f23d6 100644 --- a/source/blender/blenkernel/intern/ocean.c +++ b/source/blender/blenkernel/intern/ocean.c @@ -917,7 +917,7 @@ void BKE_ocean_init(struct Ocean *o, int M, int N, float Lx, float Lz, float V, o->_fft_in = (fftw_complex *)MEM_mallocN(o->_M * (1 + o->_N / 2) * sizeof(fftw_complex), "ocean_fft_in"); o->_htilda = (fftw_complex *)MEM_mallocN(o->_M * (1 + o->_N / 2) * sizeof(fftw_complex), "ocean_htilda"); - BLI_lock_thread(LOCK_FFTW); + BLI_thread_lock(LOCK_FFTW); if (o->_do_disp_y) { o->_disp_y = (double *)MEM_mallocN(o->_M * o->_N * sizeof(double), "ocean_disp_y"); @@ -963,7 +963,7 @@ void BKE_ocean_init(struct Ocean *o, int M, int N, float Lx, float Lz, float V, o->_Jxz_plan = fftw_plan_dft_c2r_2d(o->_M, o->_N, o->_fft_in_jxz, o->_Jxz, FFTW_ESTIMATE); } - BLI_unlock_thread(LOCK_FFTW); + BLI_thread_unlock(LOCK_FFTW); BLI_rw_mutex_unlock(&o->oceanmutex); @@ -978,7 +978,7 @@ void BKE_ocean_free_data(struct Ocean *oc) BLI_rw_mutex_lock(&oc->oceanmutex, THREAD_LOCK_WRITE); - BLI_lock_thread(LOCK_FFTW); + BLI_thread_lock(LOCK_FFTW); if (oc->_do_disp_y) { fftw_destroy_plan(oc->_disp_y_plan); @@ -1016,7 +1016,7 @@ void BKE_ocean_free_data(struct Ocean *oc) MEM_freeN(oc->_Jxz); } - BLI_unlock_thread(LOCK_FFTW); + BLI_thread_unlock(LOCK_FFTW); if (oc->_fft_in) MEM_freeN(oc->_fft_in); diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index 4ab7b76aaab..9b11b66cedd 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -170,11 +170,11 @@ void smoke_reallocate_highres_fluid(SmokeDomainSettings *sds, float dx, int res[ } /* smoke_turbulence_init uses non-threadsafe functions from fftw3 lib (like fftw_plan & co). */ - BLI_lock_thread(LOCK_FFTW); + BLI_thread_lock(LOCK_FFTW); sds->wt = smoke_turbulence_init(res, sds->amplify + 1, sds->noise, BKE_tempdir_session(), use_fire, use_colors); - BLI_unlock_thread(LOCK_FFTW); + BLI_thread_unlock(LOCK_FFTW); sds->res_wt[0] = res[0] * (sds->amplify + 1); sds->res_wt[1] = res[1] * (sds->amplify + 1); diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 3cfa8787f4b..1fb95bd3115 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -1580,12 +1580,12 @@ static void sb_sfesf_threads_run(const struct EvaluationContext *eval_ctx, Scene sb_threads[i].tot= totthread; } if (totthread > 1) { - BLI_init_threads(&threads, exec_scan_for_ext_spring_forces, totthread); + BLI_threadpool_init(&threads, exec_scan_for_ext_spring_forces, totthread); for (i=0; i<totthread; i++) - BLI_insert_thread(&threads, &sb_threads[i]); + BLI_threadpool_insert(&threads, &sb_threads[i]); - BLI_end_threads(&threads); + BLI_threadpool_end(&threads); } else exec_scan_for_ext_spring_forces(&sb_threads[0]); @@ -2192,12 +2192,12 @@ static void sb_cf_threads_run(Scene *scene, Object *ob, float forcetime, float t if (totthread > 1) { - BLI_init_threads(&threads, exec_softbody_calc_forces, totthread); + BLI_threadpool_init(&threads, exec_softbody_calc_forces, totthread); for (i=0; i<totthread; i++) - BLI_insert_thread(&threads, &sb_threads[i]); + BLI_threadpool_insert(&threads, &sb_threads[i]); - BLI_end_threads(&threads); + BLI_threadpool_end(&threads); } else exec_softbody_calc_forces(&sb_threads[0]); diff --git a/source/blender/blenkernel/intern/tracking_util.c b/source/blender/blenkernel/intern/tracking_util.c index d8e98291117..8c1b846db84 100644 --- a/source/blender/blenkernel/intern/tracking_util.c +++ b/source/blender/blenkernel/intern/tracking_util.c @@ -787,9 +787,9 @@ static ImBuf *accessor_get_ibuf(TrackingImageAccessor *accessor, * in the cache which is nice on the one hand (faster re-use of the * frames) but on the other hand it bumps the memory usage up. */ - BLI_lock_thread(LOCK_MOVIECLIP); + BLI_thread_lock(LOCK_MOVIECLIP); IMB_float_from_rect(orig_ibuf); - BLI_unlock_thread(LOCK_MOVIECLIP); + BLI_thread_unlock(LOCK_MOVIECLIP); final_ibuf = orig_ibuf; } /* Downscale if needed. */ |