From fb123f93f9f5ce42c8e5785d2f8e0edaf951740e Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Wed, 26 Mar 2014 19:21:20 +0000 Subject: Imported from /home/lorry/working-area/delta_VirtualBox/VirtualBox-4.3.10.tar.bz2. --- src/VBox/Main/include/MediumLock.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'src/VBox/Main/include/MediumLock.h') 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; @@ -88,12 +88,19 @@ 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 mMedium; + ComPtr 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. -- cgit v1.2.1