summaryrefslogtreecommitdiffstats
path: root/src/pycode.l
diff options
context:
space:
mode:
Diffstat (limited to 'src/pycode.l')
-rw-r--r--src/pycode.l14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/pycode.l b/src/pycode.l
index e136e91..b7f3b66 100644
--- a/src/pycode.l
+++ b/src/pycode.l
@@ -107,7 +107,6 @@ struct pycodeYY_state
bool endComment = FALSE;
VariableContext theVarContext;
CallContext theCallContext;
- TooltipManager tooltipManager;
SymbolResolver symbolResolver;
};
@@ -150,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;
//-------------------------------------------------------------------
@@ -488,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)
{
@@ -533,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)
{
@@ -1097,7 +1100,7 @@ static void writeMultiLineCodeLink(yyscan_t yyscanner,
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
bool sourceTooltips = Config_getBool(SOURCE_TOOLTIPS);
- yyextra->tooltipManager.addTooltip(d);
+ TooltipManager::instance().addTooltip(ol,d);
QCString ref = d->getReference();
QCString file = d->getOutputFileBase();
QCString anchor = d->anchor();
@@ -1225,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());
@@ -1335,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));
}
}
@@ -1362,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;
@@ -1385,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;
@@ -1471,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)));
}
}
@@ -1627,7 +1635,7 @@ void PythonCodeParser::parseCode(CodeOutputInterface &codeOutIntf,
yyextra->sourceFileDef=0;
}
// write the tooltips
- yyextra->tooltipManager.writeTooltips(codeOutIntf);
+ TooltipManager::instance().writeTooltips(codeOutIntf);
printlex(yy_flex_debug, FALSE, __FILE__, fileDef ? fileDef->fileName().data(): NULL);
}