# interfaces to locks
$lock_tool = "/usr/local/bin/lockfile";

## lock_set
## sets a smartlist happy lock. Returns 1 upon success, 0 otherwise

sub lock_set {
    my ($lock_file) = @_;

    print "lock_set: Trying to set lock $lock_file\n";
    $rc = system "$lock_tool",'-s 2','-r 2', $lock_file;
    if ($rc == 0) {
	print "lock_set: success\n";
	return 1;
    }
    else {
	print "lock_set: failure\n";
	return 0;
    }

} # lock_set

## lock_clear
## removes our lock

sub lock_clear {
    my ($lock_file) = @_;
    
    print "lock_clear: removing lock $lock_file\n";
    unlink ($lock_file);

} # lock_clear
