File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 6
6
#include " ModuleInternal.h"
7
7
#include " MetadataBuilder.h"
8
8
#include " SpinLock.h"
9
+ #include " Caches.h"
9
10
10
11
namespace tns {
11
12
@@ -73,6 +74,12 @@ class Runtime {
73
74
std::unique_ptr<ModuleInternal> moduleInternal_;
74
75
int workerId_;
75
76
CFRunLoopRef runtimeLoop_;
77
+ // TODO: refactor this. This is only needed because, during program termination (UIApplicationMain not called)
78
+ // the Cache::Workers is released (static initialization order fiasco https://en.cppreference.com/w/cpp/language/siof)
79
+ // so it released the Cache::Workers shared_ptr and then releases the Runtime unique_ptr
80
+ // eventually we just need to refactor so that Runtime::Initialize is responsible for its initalization
81
+ // and lifecycle
82
+ std::shared_ptr<ConcurrentMap<int , std::shared_ptr<Caches::WorkerState>>> workerCache_;
76
83
};
77
84
78
85
}
Original file line number Diff line number Diff line change 41
41
Runtime::Runtime () {
42
42
currentRuntime_ = this ;
43
43
workerId_ = -1 ;
44
+ workerCache_ = Caches::Workers;
44
45
}
45
46
46
47
Runtime::~Runtime () {
You can’t perform that action at this time.
0 commit comments