MCPcopy Create free account
hub / github.com/VCVRack/Rack / init

Function init

src/library.cpp:28–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26
27
28void init() {
29 if (!settings::autoCheckUpdates)
30 return;
31 // Dev mode is typically used when Rack or plugins are compiled from source, so updating might overwrite assets.
32 if (settings::devMode)
33 return;
34 // Safe mode disables plugin loading, so Rack will unnecessarily try to sync all plugins.
35 if (settings::safeMode)
36 return;
37
38 std::thread t([&]() {
39 system::setThreadName("Library");
40 // Wait a few seconds before updating in case library is destroyed immediately afterwards
41 {
42 std::unique_lock<std::mutex> lock(timeoutMutex);
43 if (updateCv.wait_for(lock, std::chrono::duration<double>(4.0)) != std::cv_status::timeout)
44 return;
45 }
46
47 checkAppUpdate();
48 checkUpdates();
49 });
50 t.detach();
51}
52
53
54void destroy() {

Callers

nothing calls this directly

Calls 3

setThreadNameFunction · 0.85
checkAppUpdateFunction · 0.85
checkUpdatesFunction · 0.85

Tested by

no test coverage detected