mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2026-05-01 19:39:26 +08:00
36 lines
786 B
C++
36 lines
786 B
C++
// This file is distributed under the BSD License.
|
|
// See "license.txt" for details.
|
|
// Copyright 2009, Jonathan Turner (jturner@minnow-lang.org)
|
|
// and Jason Turner (lefticus@gmail.com)
|
|
// http://www.chaiscript.com
|
|
|
|
#include <iostream>
|
|
|
|
#include <list>
|
|
|
|
#include <chaiscript/chaiscript.hpp>
|
|
|
|
|
|
void do_work(chaiscript::ChaiScript &c)
|
|
{
|
|
c("use(\"work.chai\"); do_chai_work();");
|
|
}
|
|
|
|
int main(int argc, char *argv[]) {
|
|
std::string input;
|
|
chaiscript::ChaiScript chai;
|
|
|
|
std::vector<boost::shared_ptr<boost::thread> > threads;
|
|
|
|
for (int i = 0; i < argc - 1; ++i)
|
|
{
|
|
threads.push_back(boost::shared_ptr<boost::thread>(new boost::thread(boost::bind(do_work, boost::ref(chai)))));
|
|
}
|
|
|
|
for (int i = 0; i < argc - 1; ++i)
|
|
{
|
|
threads[i]->join();
|
|
}
|
|
}
|
|
|