So how treat lock prefix with 8086 alone.
How to treat lock prefix if exists other processors like FPU.
Introduce a "Memory Lock" flag, visible by all hardware in the simulation environment.
Before any memory access operation, by any piece of hardware in the simulation environment, check the "Memory Lock" flag: if it is set, then skip this clock cycle, try again on the next clock cycle.
If the lock prefix is present on an instruction, (and if the memory lock flag has not already been set,) then set the "Memory Lock" flag, execute the instruction without obeying the "Memory Lock" flag, and when the instruction is complete, clear the "Memory Lock" flag.
If you are running all your hardware in lock-step fashion, (meaning that on each clock cycle you tick each device, and when all devices have ticked, you proceed to the next clock cycle,) then that's all you need to do.
If you are running your hardware in parallel, (meaning that on each clock cycle you simultaneously tick all available hardware on different threads,) then you may need to implement the "Memory Lock" flag as a mutex, so as to prevent devices from accidentally overwriting it.