mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-25 05:20:34 +05:00
less locks on AddVolumeElement
This commit is contained in:
parent
f008de5b04
commit
d995976621
@ -332,9 +332,6 @@ namespace netgen
|
||||
|
||||
ElementIndex Mesh :: AddVolumeElement (const Element & el)
|
||||
{
|
||||
NgLock lock(mutex);
|
||||
lock.Lock();
|
||||
|
||||
/*
|
||||
int maxn = el[0];
|
||||
for (int i = 1; i < el.GetNP(); i++)
|
||||
@ -362,7 +359,17 @@ namespace netgen
|
||||
|
||||
int ve = volelements.Size();
|
||||
|
||||
volelements.Append (el);
|
||||
if (volelements.Size() == volelements.AllocSize())
|
||||
{
|
||||
NgLock lock(mutex);
|
||||
lock.Lock();
|
||||
volelements.Append (el);
|
||||
lock.UnLock();
|
||||
}
|
||||
else
|
||||
{
|
||||
volelements.Append (el);
|
||||
}
|
||||
volelements.Last().flags.illegal_valid = 0;
|
||||
|
||||
// while (volelements.Size() > eltyps.Size())
|
||||
@ -370,7 +377,6 @@ namespace netgen
|
||||
|
||||
timestamp = NextTimeStamp();
|
||||
|
||||
lock.UnLock();
|
||||
return ve;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user