Skip to content

Commit

Permalink
lock until the transfers are canceled
Browse files Browse the repository at this point in the history
Signed-off-by: Claudiu Pop <Claudiu.Pop@analog.com>
  • Loading branch information
claudiupop committed Jan 12, 2018
1 parent b05a69f commit 2a5cf09
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/device_m1000.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -966,10 +966,14 @@ int M1000_Device::run(uint64_t samples)

int M1000_Device::cancel()
{
lock();
int ret_in = m_in_transfers.cancel();
int ret_out = m_out_transfers.cancel();
if ((ret_in != ret_out) || (ret_in != 0) || (ret_out != 0))
if ((ret_in != ret_out) || (ret_in != 0) || (ret_out != 0)){
unlock();
return -1;
}
unlock();
return 0;
}

Expand Down

0 comments on commit 2a5cf09

Please sign in to comment.