my $lock = "$stream/lock";
open $lock,'>>',$lock or error(503,"Cannot open $lock : $!");
flock $lock,LOCK_EX|LOCK_NB or error(409,"$stream already in use");
my $lock = "$stream/lock";
open $lock,'>>',$lock or error(503,"Cannot open $lock : $!");
flock $lock,LOCK_EX|LOCK_NB or error(409,"$stream already in use");