Moved zero-ing of async_pool/job inside mutex to avoid risk of race

in bdberl_drv_stop.
This commit is contained in:
Jon Meredith 2009-02-12 11:19:51 -07:00
parent 2cd33e3b83
commit d3dba23aed

View file

@ -906,10 +906,10 @@ static void tune_system(int target, void* values, BinHelper* bh)
static void async_cleanup(PortData* d)
{
// Release the port for another operation
d->async_pool = 0;
d->async_job = 0;
d->work_buffer_offset = 0;
erl_drv_mutex_lock(d->port_lock);
d->async_pool = 0;
d->async_job = 0;
d->async_op = CMD_NONE;
erl_drv_mutex_unlock(d->port_lock);
}