mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 10:13:19 +02:00
Multithreaded safety. (KICAD-T5A)
This commit is contained in:
parent
0f19ed5f9f
commit
f097fbdfcc
@ -581,20 +581,18 @@ LSET allCuMask( int aCuLayerCount )
|
|||||||
|
|
||||||
LSET LSET::AllCuMask( int aCuLayerCount )
|
LSET LSET::AllCuMask( int aCuLayerCount )
|
||||||
{
|
{
|
||||||
static LSET savedMax = allCuMask( MAX_CU_LAYERS );
|
|
||||||
static LSET cache;
|
|
||||||
static int cacheCuLayerCount = -1;
|
|
||||||
|
|
||||||
if( aCuLayerCount == MAX_CU_LAYERS )
|
if( aCuLayerCount == MAX_CU_LAYERS )
|
||||||
return savedMax;
|
return AllCuMask();
|
||||||
|
|
||||||
if( aCuLayerCount != cacheCuLayerCount )
|
return allCuMask( aCuLayerCount );
|
||||||
{
|
|
||||||
cache = allCuMask( aCuLayerCount );
|
|
||||||
cacheCuLayerCount = aCuLayerCount;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return cache;
|
|
||||||
|
LSET LSET::AllCuMask()
|
||||||
|
{
|
||||||
|
static LSET s_savedMax = allCuMask( MAX_CU_LAYERS );
|
||||||
|
|
||||||
|
return s_savedMax;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -117,7 +117,12 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Return a mask holding the requested number of Cu PCB_LAYER_IDs.
|
* Return a mask holding the requested number of Cu PCB_LAYER_IDs.
|
||||||
*/
|
*/
|
||||||
static LSET AllCuMask( int aCuLayerCount = MAX_CU_LAYERS );
|
static LSET AllCuMask( int aCuLayerCount );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* return AllCuMask( MAX_CU_LAYERS );
|
||||||
|
*/
|
||||||
|
static LSET AllCuMask();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a mask holding the Front and Bottom layers.
|
* Return a mask holding the Front and Bottom layers.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user