I don't think you need a mutex? minerloop_async should only call your driver from within a single thread.