diff options
author | Nils Fuhrmann <nf@openoffice.org> | 2001-03-01 16:44:49 +0000 |
---|---|---|
committer | Nils Fuhrmann <nf@openoffice.org> | 2001-03-01 16:44:49 +0000 |
commit | 907d64962ab83f6ae4be0900d1274a0fba072be6 (patch) | |
tree | adc8380f8cc65556b712876d7c181242fb95acc8 /tools/bootstrp | |
parent | 3de845f8226093039efc3c185b8c0a009b4ba155 (diff) |
Method NeedsUpdate() now thread save, needed for async. update of configuration without blocking main threads
Diffstat (limited to 'tools/bootstrp')
-rw-r--r-- | tools/bootstrp/mkcreate.cxx | 10 | ||||
-rw-r--r-- | tools/bootstrp/prj.cxx | 19 |
2 files changed, 21 insertions, 8 deletions
diff --git a/tools/bootstrp/mkcreate.cxx b/tools/bootstrp/mkcreate.cxx index d9a7eb9d67f8..b07ffc69f5ed 100644 --- a/tools/bootstrp/mkcreate.cxx +++ b/tools/bootstrp/mkcreate.cxx @@ -2,9 +2,9 @@ * * $RCSfile: mkcreate.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: hjs $ $Date: 2001-01-08 11:49:38 $ + * last change: $Author: nf $ $Date: 2001-03-01 17:44:49 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -216,7 +216,7 @@ SourceDirectory *SourceDirectory::GetSubDirectory( BOOL bBreak = FALSE; for ( ULONG i = sLimitation.GetTokenCount( '\\' ); i > 0 && !bBreak; i-- ) { - if ( !pActDir || ( *pActDir != sLimitation.GetToken( i - 1, '\\' ))) + if (( !pActDir ) || ( *pActDir != sLimitation.GetToken(( USHORT )( i - 1 ), '\\' ))) bBreak = TRUE; else pActDir = pActDir->pParent; @@ -796,9 +796,9 @@ BOOL SourceDirectory::CreateRecursiveMakefile( BOOL bAllChilds ) "#\n" "# $RCSfile: mkcreate.cxx,v $\n" "#\n" - "# $Revision: 1.3 $\n" + "# $Revision: 1.4 $\n" "#\n" - "# last change: $Author: hjs $ $Date: 2001-01-08 11:49:38 $\n" + "# last change: $Author: nf $ $Date: 2001-03-01 17:44:49 $\n" "#\n" "# The Contents of this file are made available subject to the terms of\n" "# either of the following licenses\n" diff --git a/tools/bootstrp/prj.cxx b/tools/bootstrp/prj.cxx index 38b6b988f9ed..a5a9e9e473e7 100644 --- a/tools/bootstrp/prj.cxx +++ b/tools/bootstrp/prj.cxx @@ -2,9 +2,9 @@ * * $RCSfile: prj.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: nf $ $Date: 2001-02-23 15:43:32 $ + * last change: $Author: nf $ $Date: 2001-03-01 17:44:49 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,6 +61,7 @@ #include <stdlib.h> #include <stdio.h> #include <sstring.hxx> +#include <vos/mutex.hxx> #include "stream.hxx" #include "geninfo.hxx" @@ -631,10 +632,14 @@ Star::~Star() BOOL Star::NeedsUpdate() /*****************************************************************************/ { + aMutex.acquire(); for ( ULONG i = 0; i < aLoadedFilesList.Count(); i++ ) - if ( aLoadedFilesList.GetObject( i )->NeedsUpdate()) + if ( aLoadedFilesList.GetObject( i )->NeedsUpdate()) { + aMutex.release(); return TRUE; + } + aMutex.release(); return FALSE; } @@ -657,7 +662,9 @@ void Star::Read( String &rFileName ) while (( aString = aSolarConfig.GetNext()) != "" ) InsertToken (( char * ) aString.GetBuffer()); } + aMutex.acquire(); aLoadedFilesList.Insert( pFile, LIST_APPEND ); + aMutex.release(); aFileList.Remove(( ULONG ) 0 ); } // resolve all dependencies recursive @@ -678,7 +685,9 @@ void Star::Read( SolarFileList *pSolarFiles ) InsertToken (( char * ) aString.GetBuffer()); } + aMutex.acquire(); aLoadedFilesList.Insert( pFile, LIST_APPEND ); + aMutex.release(); delete pSolarFiles->Remove(( ULONG ) 0 ); } delete pSolarFiles; @@ -1173,7 +1182,9 @@ USHORT StarWriter::Read( String aFileName, BOOL bReadComments, USHORT nMode ) InsertTokenLine ( aString ); } + aMutex.acquire(); aLoadedFilesList.Insert( pFile, LIST_APPEND ); + aMutex.release(); delete aFileList.Remove(( ULONG ) 0 ); } // resolve all dependencies recursive @@ -1201,7 +1212,9 @@ USHORT StarWriter::Read( SolarFileList *pSolarFiles, BOOL bReadComments ) InsertTokenLine ( aString ); } + aMutex.acquire(); aLoadedFilesList.Insert( pFile, LIST_APPEND ); + aMutex.release(); delete pSolarFiles->Remove(( ULONG ) 0 ); } delete pSolarFiles; |