#i103496#: SolarMutex in tools
This commit is contained in:
parent
b1b5009015
commit
e0cea8e136
4 changed files with 16 additions and 9 deletions
|
@ -61,7 +61,7 @@
|
|||
#import "apple_remote/RemoteMainController.h"
|
||||
#include "apple_remote/RemoteControl.h"
|
||||
#include "postmac.h"
|
||||
|
||||
#include <tools/solarmutex.hxx>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
@ -463,6 +463,7 @@ AquaSalInstance::AquaSalInstance()
|
|||
{
|
||||
mpSalYieldMutex = new SalYieldMutex;
|
||||
mpSalYieldMutex->acquire();
|
||||
::tools::SolarMutex::SetSolarMutex( mpSalYieldMutex );
|
||||
maMainThread = vos::OThread::getCurrentIdentifier();
|
||||
mbWaitingYield = false;
|
||||
maUserEventListMutex = osl_createMutex();
|
||||
|
@ -473,6 +474,7 @@ AquaSalInstance::AquaSalInstance()
|
|||
|
||||
AquaSalInstance::~AquaSalInstance()
|
||||
{
|
||||
::tools::SolarMutex::SetSolarMutex( 0 );
|
||||
mpSalYieldMutex->release();
|
||||
delete mpSalYieldMutex;
|
||||
osl_destroyMutex( maUserEventListMutex );
|
||||
|
|
|
@ -55,6 +55,7 @@
|
|||
#include <salbmp.h>
|
||||
#include <vcl/salimestatus.hxx>
|
||||
#include <vcl/timer.hxx>
|
||||
#include <tools/solarmutex.hxx>
|
||||
|
||||
// =======================================================================
|
||||
|
||||
|
@ -501,12 +502,14 @@ Os2SalInstance::Os2SalInstance()
|
|||
mpSalWaitMutex = new vos::OMutex;
|
||||
mnYieldWaitCount = 0;
|
||||
mpSalYieldMutex->acquire();
|
||||
::tools::SolarMutex::SetSolarMutex( mpSalYieldMutex );
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
Os2SalInstance::~Os2SalInstance()
|
||||
{
|
||||
::tools::SolarMutex::SetSolarMutex( 0 );
|
||||
mpSalYieldMutex->release();
|
||||
delete mpSalYieldMutex;
|
||||
delete mpSalWaitMutex;
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
#include "vcl/salwtype.hxx"
|
||||
#include "vcl/salatype.hxx"
|
||||
#include "vcl/helper.hxx"
|
||||
|
||||
#include <tools/solarmutex.hxx>
|
||||
#include "vos/mutex.hxx"
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
@ -61,6 +61,7 @@ SalYieldMutex::SalYieldMutex()
|
|||
{
|
||||
mnCount = 0;
|
||||
mnThreadId = 0;
|
||||
::tools::SolarMutex::SetSolarMutex( this );
|
||||
}
|
||||
|
||||
void SalYieldMutex::acquire()
|
||||
|
@ -139,6 +140,7 @@ X11SalInstance::~X11SalInstance()
|
|||
delete pSalData;
|
||||
SetSalData( NULL );
|
||||
|
||||
::tools::SolarMutex::SetSolarMutex( 0 );
|
||||
delete mpSalYieldMutex;
|
||||
}
|
||||
|
||||
|
|
|
@ -457,10 +457,10 @@ void InitSalData()
|
|||
{
|
||||
SalData* pSalData = new SalData;
|
||||
CoInitialize(0);
|
||||
|
||||
// init GDIPlus
|
||||
static Gdiplus::GdiplusStartupInput gdiplusStartupInput;
|
||||
Gdiplus::GdiplusStartup(&pSalData->gdiplusToken, &gdiplusStartupInput, NULL);
|
||||
|
||||
// init GDIPlus
|
||||
static Gdiplus::GdiplusStartupInput gdiplusStartupInput;
|
||||
Gdiplus::GdiplusStartup(&pSalData->gdiplusToken, &gdiplusStartupInput, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
@ -472,7 +472,7 @@ void DeInitSalData()
|
|||
// deinit GDIPlus
|
||||
if(pSalData)
|
||||
{
|
||||
Gdiplus::GdiplusShutdown(pSalData->gdiplusToken);
|
||||
Gdiplus::GdiplusShutdown(pSalData->gdiplusToken);
|
||||
}
|
||||
|
||||
delete pSalData;
|
||||
|
@ -657,18 +657,18 @@ WinSalInstance::WinSalInstance()
|
|||
{
|
||||
mhComWnd = 0;
|
||||
mpSalYieldMutex = new SalYieldMutex( this );
|
||||
::tools::SolarMutex::SetSolarMutex( mpSalYieldMutex );
|
||||
mpSalWaitMutex = new vos::OMutex;
|
||||
mnYieldWaitCount = 0;
|
||||
mpSalYieldMutex->acquire();
|
||||
::tools::SolarMutex::SetSolarMutex( mpSalYieldMutex );
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
WinSalInstance::~WinSalInstance()
|
||||
{
|
||||
mpSalYieldMutex->release();
|
||||
::tools::SolarMutex::SetSolarMutex( 0 );
|
||||
mpSalYieldMutex->release();
|
||||
delete mpSalYieldMutex;
|
||||
delete mpSalWaitMutex;
|
||||
DestroyWindow( mhComWnd );
|
||||
|
|
Loading…
Reference in a new issue