Mercurial > hg > orthanc
comparison OrthancServer/OrthancRestApi/OrthancRestSystem.cpp @ 996:cf52f3bcb2b3 lua-scripting
clarification of Lua classes wrt multithreading
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 03 Jul 2014 16:27:16 +0200 |
parents | 83622b0f544c |
children | 01414536c930 |
comparison
equal
deleted
inserted
replaced
995:8c67382f44a7 | 996:cf52f3bcb2b3 |
---|---|
88 | 88 |
89 static void ExecuteScript(RestApiPostCall& call) | 89 static void ExecuteScript(RestApiPostCall& call) |
90 { | 90 { |
91 std::string result; | 91 std::string result; |
92 ServerContext& context = OrthancRestApi::GetContext(call); | 92 ServerContext& context = OrthancRestApi::GetContext(call); |
93 context.GetLuaContext().Execute(result, call.GetPostBody()); | 93 |
94 { | |
95 ServerContext::LuaContextLocker locker(context); | |
96 locker.GetLua().Execute(result, call.GetPostBody()); | |
97 } | |
98 | |
94 call.GetOutput().AnswerBuffer(result, "text/plain"); | 99 call.GetOutput().AnswerBuffer(result, "text/plain"); |
95 } | 100 } |
96 | 101 |
97 static void GetNowIsoString(RestApiGetCall& call) | 102 static void GetNowIsoString(RestApiGetCall& call) |
98 { | 103 { |