CMapGeneratorWorker thread safety issue. Fixes #783.

VFS access moved to main thread, where random map scripts are preloaded
and stored prior to use by the worker thread.
Adds LoadGlobalScript to ScriptInterface, for evaluating script content
in the global scope.

This was SVN commit r9261.
This commit is contained in:
historic_bruno
2011-04-15 05:23:51 +00:00
parent 225346ffc9
commit 481f570a0e
4 changed files with 102 additions and 29 deletions
+11
View File
@@ -237,6 +237,14 @@ public:
*/
bool LoadScript(const VfsPath& filename, const std::wstring& code);
/**
* Load and execute the given script in the global scope.
* @param filename Name for debugging purposes (not used to load the file)
* @param code JS code to execute
* @return true on successful compilation and execution; false otherwise
*/
bool LoadGlobalScript(const VfsPath& filename, const std::wstring& code);
/**
* Load and execute the given script in the global scope.
* @return true on successful compilation and execution; false otherwise
@@ -269,6 +277,9 @@ public:
*/
void DumpHeap();
/**
* MaybeGC tries to determine whether garbage collection in cx's runtime would free up enough memory to be worth the amount of time it would take
*/
void MaybeGC();
/**