From 8ce1d51721b5d7a01ba89d6a25f1335fa3e0cb26 Mon Sep 17 00:00:00 2001 From: "Bruno G. Albuquerque" Date: Fri, 25 Apr 2008 14:50:57 +0000 Subject: [PATCH] From the BeBook: Node Locking Another feature provided by the BNode class is "node locking": Through BNode's Lock() function you can restrict access to the node. The lock is removed when Unlock() is called, or when the BNode object is deleted. There is still something wrong with locking though. For example, it looks like WriteAttr() fails on the node when we lock it (File Busy) but it should not. The lock acquirer should be able to call WriteAttr() on it. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25158 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/storage/Node.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/kits/storage/Node.cpp b/src/kits/storage/Node.cpp index 6b193de645..32bd6ce4c3 100644 --- a/src/kits/storage/Node.cpp +++ b/src/kits/storage/Node.cpp @@ -168,10 +168,11 @@ BNode::BNode(const BNode &node) } -/*! \brief Frees all resources associated with this BNode. +/*! \brief Unlocks the BNode and frees all resources associated with it. */ BNode::~BNode() { + Unlock(); Unset(); }