summaryrefslogtreecommitdiff
path: root/src/VBox/Main/include/MediumLock.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2014-03-26 19:21:20 +0000
committer <>2014-05-08 15:03:54 +0000
commitfb123f93f9f5ce42c8e5785d2f8e0edaf951740e (patch)
treec2103d76aec5f1f10892cd1d3a38e24f665ae5db /src/VBox/Main/include/MediumLock.h
parent58ed4748338f9466599adfc8a9171280ed99e23f (diff)
downloadVirtualBox-master.tar.gz
Imported from /home/lorry/working-area/delta_VirtualBox/VirtualBox-4.3.10.tar.bz2.HEADVirtualBox-4.3.10master
Diffstat (limited to 'src/VBox/Main/include/MediumLock.h')
-rw-r--r--src/VBox/Main/include/MediumLock.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/VBox/Main/include/MediumLock.h b/src/VBox/Main/include/MediumLock.h
index eaa12f8b..a65ebd03 100644
--- a/src/VBox/Main/include/MediumLock.h
+++ b/src/VBox/Main/include/MediumLock.h
@@ -6,7 +6,7 @@
*/
/*
- * Copyright (C) 2010 Oracle Corporation
+ * Copyright (C) 2010-2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -89,11 +89,18 @@ public:
bool GetLockRequest() const;
/**
+ * Check if this medium object has been locked by this MediumLock.
+ */
+ bool IsLocked() const;
+
+ /**
* Acquire a medium lock.
*
* @return COM status code
+ * @param aIgnoreLockedMedia If set ignore all media which is already
+ * locked in an incompatible way.
*/
- HRESULT Lock();
+ HRESULT Lock(bool aIgnoreLockedMedia = false);
/**
* Release a medium lock.
@@ -104,6 +111,7 @@ public:
private:
ComObjPtr<Medium> mMedium;
+ ComPtr<IToken> mToken;
AutoCaller mMediumCaller;
bool mLockWrite;
bool mIsLocked;
@@ -207,8 +215,14 @@ public:
* Acquire all medium locks "atomically", i.e. all or nothing.
*
* @return COM status code
+ * @param aSkipOverLockedMedia If set ignore all media which is already
+ * locked for reading or writing. For callers
+ * which need to know which medium objects
+ * have been locked by this lock list you
+ * can iterate over the list and check the
+ * MediumLock state.
*/
- HRESULT Lock();
+ HRESULT Lock(bool aSkipOverLockedMedia = false);
/**
* Release all medium locks.