X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBM%2FDeep.pod;h=33b7eb9c83227d9129497ebf18a46cc7afa69b01;hb=9c87a079060af9b367681cd1f96d0abd36745836;hp=7252f7c5b1855f447080b91ec2dcd42b98f1b3fe;hpb=97d40a0ac43400f8416c3e930c5626c5cb472a55;p=dbsrgits%2FDBM-Deep.git diff --git a/lib/DBM/Deep.pod b/lib/DBM/Deep.pod index 7252f7c..33b7eb9 100644 --- a/lib/DBM/Deep.pod +++ b/lib/DBM/Deep.pod @@ -385,7 +385,7 @@ value. $db->clear(); # hashes or arrays -=item * lock_exclusive() / lock_shared() / lock() / unlock() +=item * lock() / unlock() / lock_exclusive() / lock_shared() q.v. L for more info. @@ -555,12 +555,12 @@ NFS> below for more. =head2 Explicit Locking You can explicitly lock a database, so it remains locked for multiple -actions. This is done by calling the C method, and passing an -optional lock mode argument (defaults to exclusive mode). This is particularly -useful for things like counters, where the current value needs to be fetched, -then incremented, then stored again. +actions. This is done by calling the C method (for when you +want to write) or the C method (for when you want to read). +This is particularly useful for things like counters, where the current value +needs to be fetched, then incremented, then stored again. - $db->lock(); + $db->lock_exclusive(); my $counter = $db->get("counter"); $counter++; $db->put("counter", $counter); @@ -568,13 +568,10 @@ then incremented, then stored again. # or... - $db->lock(); + $db->lock_exclusive(); $db->{counter}++; $db->unlock(); -If you want a shared lock, you will need to call C. C is -an alias to C. - =head2 Win32/Cygwin Due to Win32 actually enforcing the read-only status of a shared lock, all