diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/classdef.cpp | 2 | ||||
-rw-r--r-- | src/code.l | 6 | ||||
-rw-r--r-- | src/filedef.cpp | 2 | ||||
-rw-r--r-- | src/fortrancode.l | 7 | ||||
-rw-r--r-- | src/groupdef.cpp | 2 | ||||
-rw-r--r-- | src/membergroup.cpp | 2 | ||||
-rw-r--r-- | src/memberlist.cpp | 18 | ||||
-rw-r--r-- | src/memberlist.h | 5 | ||||
-rw-r--r-- | src/namespacedef.cpp | 2 | ||||
-rw-r--r-- | src/pycode.l | 9 | ||||
-rw-r--r-- | src/util.cpp | 18 | ||||
-rw-r--r-- | src/util.h | 2 |
12 files changed, 47 insertions, 28 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp index 572b550..98cfc86 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -1144,7 +1144,7 @@ void ClassDefImpl::computeAnchors() { if ((ml->listType()&MemberListType_detailedLists)==0) { - setAnchors(ml); + ml->setAnchors(); } } @@ -244,6 +244,8 @@ static void addVariable(yyscan_t yyscanner,QCString type,QCString name); static std::mutex g_searchIndexMutex; static std::mutex g_docCrossReferenceMutex; +static std::mutex g_addExampleMutex; +static std::mutex g_countFlowKeywordsMutex; /* ----------------------------------------------------------------- */ @@ -2447,6 +2449,7 @@ static void codifyLines(yyscan_t yyscanner,const char *text) static void incrementFlowKeyWordCount(yyscan_t yyscanner) { + std::lock_guard<std::mutex> lock(g_countFlowKeywordsMutex); struct yyguts_t *yyg = (struct yyguts_t*)yyscanner; if (yyextra->currentMemberDef && yyextra->currentMemberDef->isFunction()) { @@ -2733,6 +2736,7 @@ static bool getLinkInScope(yyscan_t yyscanner, //printf("found it %s!\n",md->qualifiedName().data()); if (yyextra->exampleBlock) { + std::lock_guard<std::mutex> lock(g_addExampleMutex); QCString anchor; anchor.sprintf("a%d",yyextra->anchorCount); //printf("addExampleFile(%s,%s,%s)\n",anchor.data(),yyextra->exampleName.data(), @@ -2899,6 +2903,7 @@ static void generateClassOrGlobalLink(yyscan_t yyscanner, DBG_CTX((stderr,"is linkable class %s\n",clName)); if (yyextra->exampleBlock) { + std::lock_guard<std::mutex> lock(g_addExampleMutex); QCString anchor; anchor.sprintf("_a%d",yyextra->anchorCount); //printf("addExampleClass(%s,%s,%s)\n",anchor.data(),yyextra->exampleName.data(), @@ -2989,6 +2994,7 @@ static bool generateClassMemberLink(yyscan_t yyscanner, if (yyextra->exampleBlock) { + std::lock_guard<std::mutex> lock(g_addExampleMutex); QCString anchor; anchor.sprintf("a%d",yyextra->anchorCount); //printf("addExampleFile(%s,%s,%s)\n",anchor.data(),yyextra->exampleName.data(), diff --git a/src/filedef.cpp b/src/filedef.cpp index c2020e1..0fdcdd3 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -288,7 +288,7 @@ void FileDefImpl::setDiskName(const QCString &name) void FileDefImpl::computeAnchors() { MemberList *ml = getMemberList(MemberListType_allMembersList); - if (ml) setAnchors(ml); + if (ml) ml->setAnchors(); } void FileDefImpl::distributeMemberGroupDocumentation() diff --git a/src/fortrancode.l b/src/fortrancode.l index a3795e4..1c1287d 100644 --- a/src/fortrancode.l +++ b/src/fortrancode.l @@ -213,6 +213,11 @@ static MemberDef *getFortranDefs(yyscan_t yyscanner,const QCString &memberName, static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size); +//------------------------------------------------------------------- + +static std::mutex g_docCrossReferenceMutex; +static std::mutex g_countFlowKeywordsMutex; + /* -----------------------------------------------------------------*/ #undef YY_INPUT #define YY_INPUT(buf,result,max_size) result=yyread(yyscanner,buf,max_size); @@ -296,6 +301,7 @@ LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?") } if (yyextra->currentMemberDef && yyextra->currentMemberDef->isFunction()) { + std::lock_guard<std::mutex> lock(g_countFlowKeywordsMutex); MemberDefMutable *mdm = toMemberDefMutable(yyextra->currentMemberDef); if (mdm) { @@ -1236,6 +1242,7 @@ static bool getLink(yyscan_t yyscanner,UseSDict *usedict, // dictionary with use if (yyextra->currentDefinition && yyextra->currentMemberDef && md!=yyextra->currentMemberDef && yyextra->insideBody && yyextra->collectXRefs) { + std::lock_guard<std::mutex> lock(g_docCrossReferenceMutex); addDocCrossReference(toMemberDefMutable(yyextra->currentMemberDef),toMemberDefMutable(md)); } writeMultiLineCodeLink(yyscanner,ol,md,text ? text : memberText); diff --git a/src/groupdef.cpp b/src/groupdef.cpp index 2e01d64..bad8526 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -665,7 +665,7 @@ int GroupDefImpl::numDocMembers() const void GroupDefImpl::computeAnchors() { //printf("GroupDefImpl::computeAnchors()\n"); - setAnchors(m_allMemberList); + m_allMemberList->setAnchors(); } void GroupDefImpl::writeTagFile(FTextStream &tagFile) diff --git a/src/membergroup.cpp b/src/membergroup.cpp index d8d6193..bd3bf0c 100644 --- a/src/membergroup.cpp +++ b/src/membergroup.cpp @@ -86,7 +86,7 @@ void MemberGroup::insertMember(MemberDef *md) void MemberGroup::setAnchors() { - ::setAnchors(memberList); + memberList->setAnchors(); } void MemberGroup::writeDeclarations(OutputList &ol, diff --git a/src/memberlist.cpp b/src/memberlist.cpp index ed10bed..d8700d4 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -1143,6 +1143,24 @@ void MemberList::writeTagFile(FTextStream &tagFile) } } +// compute the HTML anchors for a list of members +void MemberList::setAnchors() +{ + //int count=0; + MemberListIterator mli(*this); + MemberDef *md; + for (;(md=mli.current());++mli) + { + MemberDefMutable *mdm = toMemberDefMutable(md); + if (mdm && !md->isReference()) + { + mdm->setAnchor(); + } + } +} + + + //-------------------------------------------------------------------------- int MemberSDict::compareValues(const MemberDef *c1, const MemberDef *c2) const diff --git a/src/memberlist.h b/src/memberlist.h index 7ee8925..e62655b 100644 --- a/src/memberlist.h +++ b/src/memberlist.h @@ -1,8 +1,6 @@ /****************************************************************************** * - * - * - * Copyright (C) 1997-2015 by Dimitri van Heesch. + * Copyright (C) 1997-2020 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -92,6 +90,7 @@ class MemberList : private QList<MemberDef> void setNeedsSorting(bool b); MemberGroupList *getMemberGroupList() const { return memberGroupList; } void setAnonymousEnumType(); + void setAnchors(); private: int compareValues(const MemberDef *item1,const MemberDef *item2) const; diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp index cef836a..0c55573 100644 --- a/src/namespacedef.cpp +++ b/src/namespacedef.cpp @@ -559,7 +559,7 @@ void NamespaceDefImpl::insertMember(MemberDef *md) void NamespaceDefImpl::computeAnchors() { MemberList *allMemberList = getMemberList(MemberListType_allMembersList); - if (allMemberList) setAnchors(allMemberList); + if (allMemberList) allMemberList->setAnchors(); } bool NamespaceDefImpl::hasDetailedDescription() const diff --git a/src/pycode.l b/src/pycode.l index 970ac91..b7f3b66 100644 --- a/src/pycode.l +++ b/src/pycode.l @@ -149,6 +149,8 @@ static void addVariable(yyscan_t yyscanner, QCString type, QCString name); //------------------------------------------------------------------- static std::mutex g_searchIndexMutex; +static std::mutex g_docCrossReferenceMutex; +static std::mutex g_countFlowKeywordsMutex; //------------------------------------------------------------------- @@ -487,6 +489,7 @@ TARGET ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBU {FLOWKW} { if (yyextra->currentMemberDef && yyextra->currentMemberDef->isFunction()) { + std::lock_guard<std::mutex> lock(g_countFlowKeywordsMutex); MemberDefMutable *mdm = toMemberDefMutable(yyextra->currentMemberDef); if (mdm) { @@ -532,6 +535,7 @@ TARGET ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBU {FLOWKW} { if (yyextra->currentMemberDef && yyextra->currentMemberDef->isFunction()) { + std::lock_guard<std::mutex> lock(g_countFlowKeywordsMutex); MemberDefMutable *mdm = toMemberDefMutable(yyextra->currentMemberDef); if (mdm) { @@ -1224,6 +1228,7 @@ static bool getLinkInScope(yyscan_t yyscanner, if (yyextra->currentDefinition && yyextra->currentMemberDef && md!=yyextra->currentMemberDef && yyextra->collectXRefs) { + std::lock_guard<std::mutex> lock(g_docCrossReferenceMutex); addDocCrossReference(toMemberDefMutable(yyextra->currentMemberDef),toMemberDefMutable(md)); } //printf("d->getReference()='%s' d->getOutputBase()='%s' name='%s' member name='%s'\n",d->getReference().data(),d->getOutputFileBase().data(),d->name().data(),md->name().data()); @@ -1334,6 +1339,7 @@ static void generateClassOrGlobalLink(yyscan_t yyscanner, if (d && d->isLinkable() && md->isLinkable() && yyextra->currentMemberDef && yyextra->collectXRefs) { + std::lock_guard<std::mutex> lock(g_docCrossReferenceMutex); addDocCrossReference(toMemberDefMutable(yyextra->currentMemberDef),toMemberDefMutable(md)); } } @@ -1361,6 +1367,7 @@ static void generateClassOrGlobalLink(yyscan_t yyscanner, if (d && d->isLinkable() && mmd->isLinkable() && yyextra->currentMemberDef && yyextra->collectXRefs) { + std::lock_guard<std::mutex> lock(g_docCrossReferenceMutex); addDocCrossReference(toMemberDefMutable(yyextra->currentMemberDef),toMemberDefMutable(mmd)); } return; @@ -1384,6 +1391,7 @@ static void generateClassOrGlobalLink(yyscan_t yyscanner, if (d && d->isLinkable() && mmd->isLinkable() && yyextra->currentMemberDef && yyextra->collectXRefs) { + std::lock_guard<std::mutex> lock(g_docCrossReferenceMutex); addDocCrossReference(toMemberDefMutable(yyextra->currentMemberDef),toMemberDefMutable(mmd)); } return; @@ -1470,6 +1478,7 @@ static bool findMemberLink(yyscan_t yyscanner, { if (yyextra->currentMemberDef && yyextra->collectXRefs) { + std::lock_guard<std::mutex> lock(g_docCrossReferenceMutex); addDocCrossReference(toMemberDefMutable(yyextra->currentMemberDef),toMemberDefMutable(toMemberDef(sym))); } } diff --git a/src/util.cpp b/src/util.cpp index 0d94138..c71d3c7 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1229,24 +1229,6 @@ QCString tempArgListToString(const ArgumentList &al,SrcLangExt lang,bool include } -// compute the HTML anchors for a list of members -// TODO: make member of MemberList -void setAnchors(MemberList *ml) -{ - //int count=0; - if (ml==0) return; - MemberListIterator mli(*ml); - MemberDef *md; - for (;(md=mli.current());++mli) - { - MemberDefMutable *mdm = toMemberDefMutable(md); - if (mdm && !md->isReference()) - { - mdm->setAnchor(); - } - } -} - //---------------------------------------------------------------------------- /*! takes the \a buf of the given length \a len and converts CR LF (DOS) @@ -137,8 +137,6 @@ void linkifyText(const TextGeneratorIntf &ol, int indentLevel=0 ); -void setAnchors(MemberList *ml); - QCString fileToString(const char *name,bool filter=FALSE,bool isSourceCode=FALSE); QCString dateToString(bool); |