VirtualBox

Changeset 69796 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Nov 21, 2017 7:38:27 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
119215
Message:

VBoxSDS: Fixed locking issue.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/VirtualBoxSDSImpl.h

    r69785 r69796  
    2222
    2323
    24 /**
    25  * Per user data.
    26  */
    27 class VBoxSDSPerUserData
    28 {
    29 public:
    30     /** The SID (secure identifier) for the user.  This is the key. */
    31     com::Utf8Str                 m_strUserSid;
    32     /** The user name (if we could get it). */
    33     com::Utf8Str                 m_strUsername;
    34     /** The VBoxSVC chosen to instantiate CLSID_VirtualBox.
    35      * This is NULL if not set. */
    36     ComPtr<IVBoxSVCRegistration> m_ptrTheChosenOne;
    37     /** Critical section protecting everything here. */
    38     RTCRITSECT                   m_Lock;
    39 
    40 
    41 public:
    42     VBoxSDSPerUserData(com::Utf8Str const &a_rStrUserSid, com::Utf8Str const &a_rStrUsername)
    43         : m_strUserSid(a_rStrUserSid), m_strUsername(a_rStrUsername)
    44     {
    45         RTCritSectInit(&m_Lock);
    46     }
    47 
    48     ~VBoxSDSPerUserData()
    49     {
    50         RTCritSectDelete(&m_Lock);
    51     }
    52 
    53     void i_lock()
    54     {
    55         RTCritSectEnter(&m_Lock);
    56     }
    57 
    58     void i_unlock()
    59     {
    60         RTCritSectLeave(&m_Lock);
    61     }
    62 };
    63 
     24class VBoxSDSPerUserData; /* See VirtualBoxSDSImpl.cpp. */
    6425
    6526/**
     
    8849private:
    8950    typedef std::map<com::Utf8Str, VBoxSDSPerUserData *> UserDataMap_T;
    90     /** Per user data map (key is SID string). */
     51    /** Per user data map (key is SID string).
     52     * This is an insert-only map! */
    9153    UserDataMap_T       m_UserDataMap;
    9254    /** Lock protecting m_UserDataMap.*/
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette