Fix multithreaded.cpp to compile / run with C++11
This commit is contained in:
parent
953c4e4847
commit
d55439a7ac
@ -11,6 +11,9 @@
|
|||||||
#include <chaiscript/chaiscript.hpp>
|
#include <chaiscript/chaiscript.hpp>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void do_work(chaiscript::ChaiScript &c)
|
void do_work(chaiscript::ChaiScript &c)
|
||||||
{
|
{
|
||||||
// c("use(\"work.chai\"); do_chai_work(num_iterations);");
|
// c("use(\"work.chai\"); do_chai_work(num_iterations);");
|
||||||
@ -30,7 +33,8 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
for (int i = 0; i < argc - 1; ++i)
|
for (int i = 0; i < argc - 1; ++i)
|
||||||
{
|
{
|
||||||
threads.push_back(std::shared_ptr<std::thread>(new std::thread(std::bind(do_work, std::ref(chai)))));
|
// std::thread t(&do_work, std::ref(chai));
|
||||||
|
threads.push_back(std::shared_ptr<std::thread>(new std::thread(&do_work, std::ref(chai))));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < argc - 1; ++i)
|
for (int i = 0; i < argc - 1; ++i)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user