MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / main

Function main

examples/threads.cc:87–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87int main() {
88 std::cout << "Initializing...\n";
89
90 Engine engine;
91 auto wat = readFile("examples/threads.wat");
92 Module module = Module::compile(engine, wat).unwrap();
93
94 std::vector<std::thread> threads;
95 threads.reserve(N_THREADS);
96 for (int i = 0; i < N_THREADS; i++)
97 threads.emplace_back(run_worker, engine, module);
98 for (auto &t : threads)
99 t.join();
100 return 0;
101}

Callers

nothing calls this directly

Calls 5

readFileFunction · 0.70
compileFunction · 0.50
unwrapMethod · 0.45
reserveMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected