File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,10 @@ private:
110110
111111 std::mutex scheduling_mutex_;
112112 std::condition_variable cv_schedule_;
113+ // lock used to protect the scheduler from asynchronous requests (i.e. from
114+ // enclaves pr federates). We hold the mutex from construction and release in
115+ // start().
116+ std::unique_lock<std::mutex> startup_lock_{scheduling_mutex_};
113117
114118 std::shared_mutex mutex_event_queue_;
115119 std::map<Tag, ActionListPtr> event_queue_;
Original file line number Diff line number Diff line change @@ -214,6 +214,11 @@ void Scheduler::start() {
214214 set_ports_.resize (num_workers);
215215 triggered_reactions_.resize (num_workers);
216216
217+ // release the scheduling mutex, allowing other asynchronous processes (i.e.
218+ // enclaves or federates) to access the event queue and the current logical
219+ // time.
220+ startup_lock_.unlock ();
221+
217222 // Initialize and start the workers. By resizing the workers vector first,
218223 // we make sure that there is sufficient space for all the workers and non of
219224 // them needs to be moved. This is important because a running worker may not
You can’t perform that action at this time.
0 commit comments