analogdevicesinc / libsmu

Software abstractions for the analog signal exploration tools.
http://analogdevicesinc.github.io/libsmu/
BSD 3-Clause "New" or "Revised" License
32 stars 31 forks source link

session.cpp: fixed cancellation bug. #160

Closed cristi-iacob closed 4 years ago

cristi-iacob commented 4 years ago

The cancel() call is needed in order to cancel the current transfers from each connected device before turning them off, when running in a continuous fashion. This prevents libsmu from getting into a deadlock because of the m_state mutex locked in the run() method. The m_cancellation flag must be removed from the if-statement because it is only set in the device->cancel() method, preventing the program from entering this if statement.

This bug was introduced in 0548b85. The introduced bug has hidden by Pixelpulse, which I have used to test that modification. In Pixelpulse, session->close() was called before session->end(), solving the above mentioned threading issue.

Signed-off-by: Cristi Iacob cristian.iacob@analog.com