# -*- perl -*-

# t/001_load.t - check module loading and create testing directory

use Test::More tests => 1;
use App::Locker;
use threads;

$SIG{ALRM}=sub{
  exit;
};
alarm(3);

my $locker=App::Locker->create;

sub test{
  my ($l)=@_;
  
  sleep(1);
  my $p='test';
  $l->unlock(\$p);
}


my $thr=threads->create(\&test, $locker);

print "LOCK\n";
my $p=$locker->lock();
print ${$p};
print "UNLOCK\n";
$thr->join();

is(${$p},'test', "thread_transfer_test");
