Initial check in of multithreaded support for chaiscript

This commit is contained in:
Jason Turner
2009-08-31 19:50:41 +00:00
parent ff639a267d
commit 6c4872eae9
6 changed files with 156 additions and 34 deletions

View File

@@ -280,8 +280,12 @@ namespace chaiscript
*/
Object_Cache &get_object_cache()
{
static Object_Cache oc;
return oc;
static boost::thread_specific_ptr<Object_Cache> oc;
if (!oc.get())
{
oc.reset(new Object_Cache);
}
return *oc;
}
/**