#!/usr/bin/perl
#use Fcntl q{:flock};
#use Mooix::Thing;
run sub {
	my $this=shift;
	%_=@_;
	my $avatar=$_{avatar};

	# Lock both this side and the otherside.
	require $this->fieldfile("getlock.pl");
	my @locks=getduallock($this, LOCK_EX, "closed");
	
	if (! $this->closed) {
		fail "It's already open.";
	}
	if ($this->locked || ! $this->open(quiet => 1)) {
		$this->msg('openfail', %_);
		fail;
	}
	
	$this->msg('open', %_);
}
