User`s guide

5 Acquiring Image Data
5-32
done. Insert this code just before the acquisition thread function breaks out of the
frame acquisition loop — see “Implementing the Acquisition Thread Function” on
page 5-18.
You can use the IAutoCriticaSection::leave() function but this is not
necessary. The IAutoCriticalSection leaves the critical section automatically
when the code section goes out of scope. You might want to include explicit calls
to the leave() function in your code to help document the extent of your critical
section.
bool MyDeviceAdaptor::stopCapture(){
// If the device is not acquiring data, return.
if (!isAcquiring())
return true;
// Get the critical section and enter it.
std::auto_ptr<imaqkit::IAutoCriticalSection>
GrabSection(imaqkit::createAutoCriticalSection(_grabSection,
true));
//**********************************************************
// Insert calls to your device's SDK to stop the device, if
// necessary.
//**********************************************************
// Leave the critical section.
GrabSection->leave();
return true;
}