summaryrefslogtreecommitdiffstats
path: root/urpm/lock.pm
diff options
context:
space:
mode:
Diffstat (limited to 'urpm/lock.pm')
-rw-r--r--urpm/lock.pm41
1 files changed, 31 insertions, 10 deletions
diff --git a/urpm/lock.pm b/urpm/lock.pm
index 2b7855a8..358b63a1 100644
--- a/urpm/lock.pm
+++ b/urpm/lock.pm
@@ -18,14 +18,9 @@ urpm::lock - urpm/rpm DB locking related routines for urpmi
=head1 DESCRIPTION
-=over
-
-=cut
-
-
-################################################################################
-#- class functions
+=head1 CLASS FUNCTIONS
+=over
=item rpm_db($urpm, $b_exclusive, %options)
@@ -58,11 +53,29 @@ sub urpmi_db {
urpm::lock->new($urpm, "$urpm->{statedir}/.LOCK", 'urpmi', $b_exclusive, %options);
}
+=back
+
+=head1 METHODS
+
+=over
+
+=item new($_class, $urpm, $file, $db_name, $b_exclusive, %options)
+
+Create a new lock.
+You don't want to use it directly. Either use urpmi_db() or rpm_db().
+
+Options:
-################################################################################
-#- methods
+=over 4
+
+=item * nofatal
+
+=item * wait
+
+=back
+
+=cut
-# (options: nofatal, wait)
sub new {
my ($_class, $urpm, $file, $db_name, $b_exclusive, %options) = @_;
@@ -121,6 +134,14 @@ sub _lock {
$lock->{exclusive} = $b_exclusive;
}
+
+=item unlock($lock)
+
+Free a lock.
+
+=cut
+
+
sub unlock {
my ($lock) = @_;
$lock->{fh} or warn "lock $lock->{db_name} already released\n", return;