add lock on do_stop command
This commit is contained in:
parent
d5325e9a4c
commit
b78afdc9a0
|
@ -4117,7 +4117,7 @@ int hg_scanner::wait_one_image_from_start(bool& handled)
|
|||
int ret = SCANNER_ERR_OK;
|
||||
|
||||
handled = false;
|
||||
if (!async_io_) // non-callback
|
||||
if (!async_io_) // non-callback, async do this in upper level
|
||||
{
|
||||
while (is_running() != THREAD_RUNNING_IDLE)
|
||||
{
|
||||
|
|
|
@ -1642,6 +1642,7 @@ int hg_scanner_239::do_start(void)
|
|||
int hg_scanner_239::do_stop(void)
|
||||
{
|
||||
int ret = SCANNER_ERR_OK;
|
||||
std::lock_guard<std::mutex> lock(io_lock_);
|
||||
|
||||
ret = write_command(setting3399::SC_STOP);
|
||||
io_->set_timeout(500);
|
||||
|
|
Loading…
Reference in New Issue