Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extern bool TopOpeBRep_GetcontextNEWKP();

// VP<STATIC_lastVPind> is the vp on which was computed the last CPI.
// if no CPI is computed yet, <STATIC_lastVPind> = 0.
static int STATIC_lastVPind;
static thread_local int STATIC_lastVPind; // per-thread cross-call cache

#define M_FORWARD(st) (st == TopAbs_FORWARD)
#define M_REVERSED(st) (st == TopAbs_REVERSED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ Standard_EXPORT void debspf(const int i)
}
#endif

static int STATIC_SOLIDINDEX = 0;
// Per-thread: a SplitSolid/FillSolid state flag; sharing it races concurrent builds.
static thread_local int STATIC_SOLIDINDEX = 0;

//=================================================================================================

Expand Down
13 changes: 6 additions & 7 deletions src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstRad.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,12 @@ bool BlendFunc_ConstRad::ComputeValues(const math_Vector& X,
const bool byParam,
const double Param)
{
// static declaration to avoid systematic reallocation

static gp_Vec d3u1, d3v1, d3uuv1, d3uvv1, d3u2, d3v2, d3uuv2, d3uvv2;
static gp_Vec d1gui, d2gui, d3gui;
static gp_Pnt ptgui;
static double invnormtg, dinvnormtg;
double T = Param, aux;
// Per-thread scratch, reused across calls via the t_OK / myX_OK guards below.
static thread_local gp_Vec d3u1, d3v1, d3uuv1, d3uvv1, d3u2, d3v2, d3uuv2, d3uvv2;
static thread_local gp_Vec d1gui, d2gui, d3gui;
static thread_local gp_Pnt ptgui;
static thread_local double invnormtg, dinvnormtg;
double T = Param, aux;

// Case of implicite parameter
if (!byParam)
Expand Down
13 changes: 6 additions & 7 deletions src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_EvolRad.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,12 @@ bool BlendFunc_EvolRad::ComputeValues(const math_Vector& X,
const bool byParam,
const double Param)
{
// static declaration to avoid systematic realloc

static gp_Vec d3u1, d3v1, d3uuv1, d3uvv1, d3u2, d3v2, d3uuv2, d3uvv2;
static gp_Vec d1gui, d2gui, d3gui;
static gp_Pnt ptgui;
static double invnormtg, dinvnormtg;
double T = Param, aux;
// Per-thread scratch, reused across calls via the t_OK / myX_OK guards below.
static thread_local gp_Vec d3u1, d3v1, d3uuv1, d3uvv1, d3u2, d3v2, d3uuv2, d3uvv2;
static thread_local gp_Vec d1gui, d2gui, d3gui;
static thread_local gp_Pnt ptgui;
static thread_local double invnormtg, dinvnormtg;
double T = Param, aux;

// Case of implicit parameter
if (!byParam)
Expand Down
3 changes: 2 additions & 1 deletion src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_6.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,8 @@ bool ChFi3d_Builder::StoreData(occ::handle<ChFiDS_SurfData>& Data,
const bool Reversed)
{
// Small control tools.
static occ::handle<GeomAdaptor_Curve> checkcurve;
// Per-thread reused scratch adaptor.
static thread_local occ::handle<GeomAdaptor_Curve> checkcurve;
if (checkcurve.IsNull())
{
checkcurve = new GeomAdaptor_Curve();
Expand Down
Loading