On 18/10/2018 19:10, Artem Pisarenko wrote: > >> No, you're right. The if should remain in the caller, or >> need_replay_checkpoint must be initialized with replay_mode. > > If initialize 'need_replay_checkpoint', then it should also account for > clock != QEMU_CLOCK_REALTIME.
Or you just get a unlock/lock pair for QEMU_CLOCK_REALTIME (which should really never happen if e.g. you have no UI). > And here we come to what if+switch block > actually (mostly) does in my version. Finally, you will get duplication > of this whole condition usage between source function and extracted > function, which isn't nice. > Why do you want to split up such tightly coupled code? Because it's *too* coupled and not very readable. Paolo