MCPcopy Create free account
hub / github.com/MITK/MITK / StartAlgorithm

Method StartAlgorithm

Modules/AlgorithmsExt/src/mitkNonBlockingAlgorithm.cpp:89–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87 }
88
89 void NonBlockingAlgorithm::StartAlgorithm()
90 {
91 if (!ReadyToRun())
92 return; // let algorithm check if all input/parameters are ok
93 if (m_KillRequest)
94 return; // someone wants us to die
95
96 m_ParameterListMutex.lock();
97 ++m_UpdateRequests;
98 m_ParameterListMutex.unlock();
99 if (m_Thread.joinable()) // thread already running. But something obviously wants us to recalculate the output
100 {
101 return; // thread already running
102 }
103
104 // spawn a thread that calls ThreadedUpdateFunction(), and ThreadedUpdateFinished() on us
105 this->Register();
106 m_Thread = std::thread(StaticNonBlockingAlgorithmThread, this);
107 }
108
109 void NonBlockingAlgorithm::StopAlgorithm()
110 {

Callers 2

Calls 3

lockMethod · 0.45
unlockMethod · 0.45
RegisterMethod · 0.45

Tested by

no test coverage detected