use erl_drv_send_term on R16 and use mutex