Browse Source

Multithreaded safety. (KICAD-T5A)

pull/18/head
Jeff Young 4 months ago
parent
commit
f097fbdfcc
  1. 20
      common/lset.cpp
  2. 7
      include/lset.h

20
common/lset.cpp

@ -581,20 +581,18 @@ 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 )
return savedMax;
return AllCuMask();
if( aCuLayerCount != cacheCuLayerCount )
{
cache = allCuMask( aCuLayerCount );
cacheCuLayerCount = aCuLayerCount;
}
return allCuMask( aCuLayerCount );
}
LSET LSET::AllCuMask()
{
static LSET s_savedMax = allCuMask( MAX_CU_LAYERS );
return cache;
return s_savedMax;
}

7
include/lset.h

@ -117,7 +117,12 @@ public:
/**
* 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.

Loading…
Cancel
Save