File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
ydb/core/fq/libs/row_dispatcher Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 1
1
#include " common.h"
2
2
3
+ #include < util/system/mutex.h>
4
+
3
5
#include < ydb/library/yql/public/purecalc/common/interface.h>
4
6
5
7
namespace NFq {
@@ -9,22 +11,21 @@ namespace {
9
11
class TPureCalcProgramFactory : public IPureCalcProgramFactory {
10
12
public:
11
13
NYql::NPureCalc::IProgramFactoryPtr GetFactory (const TSettings& settings) override {
14
+ TGuard<TMutex> guard (FactoriesMutex);
15
+
12
16
const auto it = ProgramFactories.find (settings);
13
17
if (it != ProgramFactories.end ()) {
14
18
return it->second ;
15
19
}
16
- return CreateFactory (settings);
17
- }
18
20
19
- private:
20
- NYql::NPureCalc::IProgramFactoryPtr CreateFactory (const TSettings& settings) {
21
21
return ProgramFactories.insert ({settings, NYql::NPureCalc::MakeProgramFactory (
22
22
NYql::NPureCalc::TProgramFactoryOptions ()
23
23
.SetLLVMSettings (settings.EnabledLLVM ? " ON" : " OFF" )
24
24
)}).first ->second ;
25
25
}
26
26
27
27
private:
28
+ TMutex FactoriesMutex;
28
29
std::map<TSettings, NYql::NPureCalc::IProgramFactoryPtr> ProgramFactories;
29
30
};
30
31
You can’t perform that action at this time.
0 commit comments