MCPcopy Create free account
hub / github.com/RenderKit/embree / commit_internal

Method commit_internal

kernels/common/scene.cpp:939–975  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

937#if defined(TASKING_INTERNAL)
938
939 void Scene::commit_internal (bool join)
940 {
941 Lock<MutexSys> buildLock(buildMutex,false);
942
943 /* allocates own taskscheduler for each build */
944 Ref<TaskScheduler> scheduler = nullptr;
945 {
946 Lock<MutexSys> lock(taskGroup->schedulerMutex);
947 scheduler = taskGroup->scheduler;
948 if (scheduler == null) {
949 buildLock.lock();
950 taskGroup->scheduler = scheduler = new TaskScheduler;
951 }
952 }
953
954 /* worker threads join build */
955 if (!buildLock.isLocked())
956 {
957 if (!join)
958 throw_RTCError(RTC_ERROR_INVALID_OPERATION,"use rtcJoinCommitScene to join a build operation");
959
960 scheduler->join();
961 return;
962 }
963
964 /* initiate build */
965 try {
966 TaskScheduler::TaskGroupContext context;
967 scheduler->spawn_root([&]() { commit_task(); Lock<MutexSys> lock(taskGroup->schedulerMutex); taskGroup->scheduler = nullptr; }, &context, 1, !join);
968 }
969 catch (...) {
970 accels_clear();
971 Lock<MutexSys> lock(taskGroup->schedulerMutex);
972 taskGroup->scheduler = nullptr;
973 throw;
974 }
975 }
976
977#endif
978

Callers

nothing calls this directly

Calls 15

pause_cpuFunction · 0.85
yieldFunction · 0.85
_mm_getcsrFunction · 0.85
parallel_forFunction · 0.85
isModifiedFunction · 0.85
joinMethod · 0.80
spawn_rootMethod · 0.80
_mm_setcsrFunction · 0.50
lockMethod · 0.45
isLockedMethod · 0.45
try_lockMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected