MCPcopy Create free account
hub / github.com/TypesettingTools/Aegisub / Sync

Method Sync

libaegisub/common/dispatch.cpp:106–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106void Queue::Sync(Thunk&& thunk) {
107 std::mutex m;
108 std::condition_variable cv;
109 std::unique_lock<std::mutex> l(m);
110 std::exception_ptr e;
111 bool done = false;
112 DoInvoke([&]{
113 std::unique_lock<std::mutex> l(m);
114 try {
115 thunk();
116 }
117 catch (...) {
118 e = std::current_exception();
119 }
120 done = true;
121 cv.notify_all();
122 });
123 cv.wait(l, [&]{ return done; });
124 if (e) std::rethrow_exception(e);
125}
126
127Queue& Main() {
128 static MainQueue q;

Callers 14

~SubsControllerMethod · 0.80
OnLanguageChangedMethod · 0.80
ShowDialogMethod · 0.80
LuaDisplayOpenDialogMethod · 0.80
LuaDisplaySaveDialogMethod · 0.80
clipboard_getFunction · 0.80
clipboard_setFunction · 0.80
rendererMethod · 0.80
~AsyncVideoProviderMethod · 0.80
GetFrameMethod · 0.80
~LogSinkMethod · 0.80
SubscribeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected