summaryrefslogtreecommitdiffstats
path: root/src/entry.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2020-06-17 18:49:11 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2020-06-17 18:49:11 (GMT)
commitd0f24b762e23b1b0c069209978aa403acc027cdf (patch)
tree0d4d9deffeb4d0b2a809b1807dc52d88bf5d80e9 /src/entry.cpp
parent46672f1e6ea2c63e54c0fc8420d6ebdaca958478 (diff)
downloadDoxygen-d0f24b762e23b1b0c069209978aa403acc027cdf.zip
Doxygen-d0f24b762e23b1b0c069209978aa403acc027cdf.tar.gz
Doxygen-d0f24b762e23b1b0c069209978aa403acc027cdf.tar.bz2
Multi-threaded parsing: added locks around global data
Diffstat (limited to 'src/entry.cpp')
-rw-r--r--src/entry.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/entry.cpp b/src/entry.cpp
index e5f6d90..6e343b0 100644
--- a/src/entry.cpp
+++ b/src/entry.cpp
@@ -24,18 +24,15 @@
#include "doxygen.h"
#include "arguments.h"
#include "config.h"
-//------------------------------------------------------------------
-
-#define HEADER ('D'<<24)+('O'<<16)+('X'<<8)+'!'
//------------------------------------------------------------------
-int Entry::num=0;
+static AtomicInt g_num;
Entry::Entry()
{
//printf("Entry::Entry(%p)\n",this);
- num++;
+ g_num++;
m_parent=0;
section = EMPTY_SEC;
//printf("Entry::Entry() tArgList=0\n");
@@ -50,7 +47,7 @@ Entry::Entry()
Entry::Entry(const Entry &e)
{
//printf("Entry::Entry(%p):copy\n",this);
- num++;
+ g_num++;
section = e.section;
type = e.type;
name = e.name;
@@ -123,11 +120,11 @@ Entry::Entry(const Entry &e)
Entry::~Entry()
{
- //printf("Entry::~Entry(%p) num=%d\n",this,num);
+ //printf("Entry::~Entry(%p) num=%d\n",this,g_num);
//printf("Deleting entry %d name %s type %x children %d\n",
// num,name.data(),section,sublist->count());
- num--;
+ g_num--;
}
void Entry::moveToSubEntryAndRefresh(Entry *&current)
@@ -183,10 +180,10 @@ void Entry::removeSubEntry(const Entry *e)
void Entry::reset()
{
- static bool entryCallGraph = Config_getBool(CALL_GRAPH);
- static bool entryCallerGraph = Config_getBool(CALLER_GRAPH);
- static bool entryReferencedByRelation = Config_getBool(REFERENCED_BY_RELATION);
- static bool entryReferencesRelation = Config_getBool(REFERENCES_RELATION);
+ bool entryCallGraph = Config_getBool(CALL_GRAPH);
+ bool entryCallerGraph = Config_getBool(CALLER_GRAPH);
+ bool entryReferencedByRelation = Config_getBool(REFERENCED_BY_RELATION);
+ bool entryReferencesRelation = Config_getBool(REFERENCES_RELATION);
//printf("Entry::reset()\n");
name.resize(0);
type.resize(0);