VirtualBox

Changeset 19570 in vbox for trunk


Ignore:
Timestamp:
May 11, 2009 9:00:58 AM (16 years ago)
Author:
vboxsync
Message:

Use RT critical sections, so we get an assertion for deadlocks

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxFrameBuffer.h

    r19134 r19570  
    2525
    2626#include "COMDefs.h"
     27#include <iprt/critsect.h>
    2728
    2829/* Qt includes */
     
    222223    }
    223224
    224     void lock() { mMutex->lock(); }
    225     void unlock() { mMutex->unlock(); }
     225    void lock() { RTCritSectEnter(&mCritSect); }
     226    void unlock() { RTCritSectLeave(&mCritSect); }
    226227
    227228    virtual uchar *address() = 0;
     
    254255
    255256    VBoxConsoleView *mView;
    256     QMutex *mMutex;
     257    RTCRITSECT mCritSect;
    257258    int mWdt;
    258259    int mHgt;
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFrameBuffer.cpp

    r18635 r19570  
    4545
    4646VBoxFrameBuffer::VBoxFrameBuffer (VBoxConsoleView *aView)
    47     : mView (aView), mMutex (new QMutex (QMutex::Recursive))
     47    : mView (aView)
    4848    , mWdt (0), mHgt (0)
    4949#if defined (Q_OS_WIN32)
     
    5353    AssertMsg (mView, ("VBoxConsoleView must not be null\n"));
    5454    mWinId = (mView && mView->viewport()) ? (ULONG64) mView->viewport()->winId() : 0;
     55    int rc = RTCritSectInit(&mCritSect);
     56    AssertRC(rc);
    5557}
    5658
    5759VBoxFrameBuffer::~VBoxFrameBuffer()
    5860{
    59     delete mMutex;
     61    RTCritSectDelete(&mCritSect);
    6062}
    6163
Note: See TracChangeset for help on using the changeset viewer.

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