$sub proposed in a nearby thread. Looks like we have a consensus that $subj is beneficial. I implemented necessary legwork, namely a clock-based check in the wait() routine, PFA. I'm not sure the default pg_sleep argument of 50 millisecond is good, but it is fast enough to not spot any difference in by-hand testing.
[0] https://www.postgresql.org/message-id/aKT7qD0VkGhQgFJe%40paquier.xyz -- Best regards, Kirill Reshke
v1-0001-Remove-condition-variables-from-injection-wait-lo.patch
Description: Binary data