VirtualBox

Changeset 38743 in vbox


Ignore:
Timestamp:
Sep 13, 2011 2:54:35 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
74014
Message:

Main: AutoMultiWriteLock4

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/com/AutoLock.h

    r38717 r38743  
    608608};
    609609
     610/**
     611 * A multi-write-lock containing four other write locks.
     612 *
     613 */
     614class AutoMultiWriteLock4 : public AutoWriteLockBase
     615{
     616public:
     617    AutoMultiWriteLock4(Lockable *pl1,
     618                        Lockable *pl2,
     619                        Lockable *pl3,
     620                        Lockable *pl4
     621                        COMMA_LOCKVAL_SRC_POS_DECL);
     622    AutoMultiWriteLock4(LockHandle *pl1,
     623                        LockHandle *pl2,
     624                        LockHandle *pl3,
     625                        LockHandle *pl4
     626                        COMMA_LOCKVAL_SRC_POS_DECL);
     627
     628    virtual ~AutoMultiWriteLock4()
     629    {
     630        cleanup();
     631    }
     632};
     633
    610634} /* namespace util */
    611635
  • trunk/src/VBox/Main/glue/AutoLock.cpp

    r38717 r38743  
    752752}
    753753
     754AutoMultiWriteLock4::AutoMultiWriteLock4(Lockable *pl1,
     755                                         Lockable *pl2,
     756                                         Lockable *pl3,
     757                                         Lockable *pl4
     758                                         COMMA_LOCKVAL_SRC_POS_DECL)
     759    : AutoWriteLockBase(4
     760                        COMMA_LOCKVAL_SRC_POS_ARGS)
     761{
     762    if (pl1)
     763        m->aHandles[0] = pl1->lockHandle();
     764    if (pl2)
     765        m->aHandles[1] = pl2->lockHandle();
     766    if (pl3)
     767        m->aHandles[2] = pl3->lockHandle();
     768    if (pl4)
     769        m->aHandles[3] = pl4->lockHandle();
     770    acquire();
     771}
     772
     773AutoMultiWriteLock4::AutoMultiWriteLock4(LockHandle *pl1,
     774                                         LockHandle *pl2,
     775                                         LockHandle *pl3,
     776                                         LockHandle *pl4
     777                                         COMMA_LOCKVAL_SRC_POS_DECL)
     778    : AutoWriteLockBase(4
     779                        COMMA_LOCKVAL_SRC_POS_ARGS)
     780{
     781    m->aHandles[0] = pl1;
     782    m->aHandles[1] = pl2;
     783    m->aHandles[2] = pl3;
     784    m->aHandles[3] = pl4;
     785    acquire();
     786}
     787
    754788} /* namespace util */
    755789/* vi: set tabstop=4 shiftwidth=4 expandtab: */
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