NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-xen/50659: Xen4.5 crash with vnds

On Thu, Mar 24, 2016 at 11:35:48PM +0100, Christoph Badura wrote:
> There's always the option to create an flock package and use the binary
> from that on old systems.

However, I think we can use a named pipe as a condition variable.
Something along the following lines:

mkfifo foo.fifo 2>/dev/null
unlock() { rm foo.lock; exec 4<>foo.fifo; exec 4<&-; }
lock() {
	until shlock -f foo.lock -p $$; do
		exec 4< foo.fifo ; exec 4<&-
	exec 4<> foo.fifo; exec 4<&-

zorch() { echo zorch:; cat; }

lock; zorch; unlock


Home | Main Index | Thread Index | Old Index