comparison OrthancServer/LuaScripting.cpp @ 2618:ef5b45884972 jobs

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 22 May 2018 12:59:38 +0200
parents 2f3007bf0708
children 1232922c8793
comparison
equal deleted inserted replaced
2617:912a767911b0 2618:ef5b45884972
534 std::auto_ptr<IDynamicObject> event(that->pendingEvents_.Dequeue(100)); 534 std::auto_ptr<IDynamicObject> event(that->pendingEvents_.Dequeue(100));
535 535
536 if (event.get() == NULL) 536 if (event.get() == NULL)
537 { 537 {
538 // The event queue is empty, check whether we should stop 538 // The event queue is empty, check whether we should stop
539 boost::mutex::scoped_lock lock(that->mutex_); 539 boost::recursive_mutex::scoped_lock lock(that->mutex_);
540 540
541 if (!that->continue_) 541 if (!that->continue_)
542 { 542 {
543 return; 543 return;
544 } 544 }
558 } 558 }
559 559
560 560
561 void LuaScripting::Start() 561 void LuaScripting::Start()
562 { 562 {
563 boost::mutex::scoped_lock lock(mutex_); 563 boost::recursive_mutex::scoped_lock lock(mutex_);
564 564
565 if (!continue_ || 565 if (!continue_ ||
566 eventThread_.joinable() /* already started */) 566 eventThread_.joinable() /* already started */)
567 { 567 {
568 throw OrthancException(ErrorCode_BadSequenceOfCalls); 568 throw OrthancException(ErrorCode_BadSequenceOfCalls);
576 576
577 577
578 void LuaScripting::Stop() 578 void LuaScripting::Stop()
579 { 579 {
580 { 580 {
581 boost::mutex::scoped_lock lock(mutex_); 581 boost::recursive_mutex::scoped_lock lock(mutex_);
582 582
583 if (!continue_) 583 if (!continue_)
584 { 584 {
585 throw OrthancException(ErrorCode_BadSequenceOfCalls); 585 throw OrthancException(ErrorCode_BadSequenceOfCalls);
586 } 586 }
631 bool LuaScripting::FilterIncomingInstance(const DicomInstanceToStore& instance, 631 bool LuaScripting::FilterIncomingInstance(const DicomInstanceToStore& instance,
632 const Json::Value& simplified) 632 const Json::Value& simplified)
633 { 633 {
634 static const char* NAME = "ReceivedInstanceFilter"; 634 static const char* NAME = "ReceivedInstanceFilter";
635 635
636 boost::mutex::scoped_lock lock(mutex_); 636 boost::recursive_mutex::scoped_lock lock(mutex_);
637 637
638 if (lua_.IsExistingFunction(NAME)) 638 if (lua_.IsExistingFunction(NAME))
639 { 639 {
640 LuaFunctionCall call(lua_, NAME); 640 LuaFunctionCall call(lua_, NAME);
641 call.PushJson(simplified); 641 call.PushJson(simplified);