diff Framework/Viewport/WidgetViewport.cpp @ 53:c2dc924f1a63 wasm

removing threading out of the framework
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 27 Apr 2017 16:57:49 +0200
parents 25befef48c35
children 01aa453d4d5b
line wrap: on
line diff
--- a/Framework/Viewport/WidgetViewport.cpp	Thu Apr 27 14:50:40 2017 +0200
+++ b/Framework/Viewport/WidgetViewport.cpp	Thu Apr 27 16:57:49 2017 +0200
@@ -50,8 +50,6 @@
 
   void WidgetViewport::SetStatusBar(IStatusBar& statusBar)
   {
-    boost::mutex::scoped_lock lock(mutex_);
-
     statusBar_ = &statusBar;
 
     if (centralWidget_.get() != NULL)
@@ -63,8 +61,6 @@
 
   void WidgetViewport::ResetStatusBar()
   {
-    boost::mutex::scoped_lock lock(mutex_);
-
     statusBar_ = NULL;
 
     if (centralWidget_.get() != NULL)
@@ -81,8 +77,6 @@
       throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
     }
 
-    boost::mutex::scoped_lock lock(mutex_);
-
     if (widget == NULL)
     {
       throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
@@ -117,8 +111,6 @@
 
   void WidgetViewport::Start()
   {
-    boost::mutex::scoped_lock lock(mutex_);
-
     if (centralWidget_.get() != NULL)
     {
       centralWidget_->Start();
@@ -130,8 +122,6 @@
 
   void WidgetViewport::Stop()
   {
-    boost::mutex::scoped_lock lock(mutex_);
-
     started_ = false;
 
     if (centralWidget_.get() != NULL)
@@ -144,8 +134,6 @@
   void WidgetViewport::SetSize(unsigned int width,
                                unsigned int height)
   {
-    boost::mutex::scoped_lock lock(mutex_);
-
     background_.SetSize(width, height);
 
     if (centralWidget_.get() != NULL)
@@ -159,8 +147,6 @@
 
   bool WidgetViewport::Render(Orthanc::ImageAccessor& surface)
   {
-    boost::mutex::scoped_lock lock(mutex_);
-
     if (!started_ ||
         centralWidget_.get() == NULL)
     {
@@ -201,8 +187,6 @@
                                  int y,
                                  KeyboardModifiers modifiers)
   {
-    boost::mutex::scoped_lock lock(mutex_);
-
     if (!started_)
     {
       return;
@@ -226,8 +210,6 @@
 
   void WidgetViewport::MouseUp()
   {
-    boost::mutex::scoped_lock lock(mutex_);
-
     if (!started_)
     {
       return;
@@ -245,8 +227,6 @@
   void WidgetViewport::MouseMove(int x, 
                                  int y) 
   {
-    boost::mutex::scoped_lock lock(mutex_);
-
     if (!started_)
     {
       return;
@@ -267,7 +247,6 @@
 
   void WidgetViewport::MouseEnter()
   {
-    boost::mutex::scoped_lock lock(mutex_);
     isMouseOver_ = true;
     observers_.NotifyChange(this);
   }
@@ -275,7 +254,6 @@
 
   void WidgetViewport::MouseLeave()
   {
-    boost::mutex::scoped_lock lock(mutex_);
     isMouseOver_ = false;
 
     if (started_ &&
@@ -294,8 +272,6 @@
                                   int y,
                                   KeyboardModifiers modifiers)
   {
-    boost::mutex::scoped_lock lock(mutex_);
-
     if (!started_)
     {
       return;
@@ -312,8 +288,6 @@
   void WidgetViewport::KeyPressed(char key,
                                   KeyboardModifiers modifiers)
   {
-    boost::mutex::scoped_lock lock(mutex_);
-
     if (centralWidget_.get() != NULL &&
         mouseTracker_.get() == NULL)
     {
@@ -324,8 +298,6 @@
 
   bool WidgetViewport::HasUpdateContent()
   {
-    boost::mutex::scoped_lock lock(mutex_);
-
     if (centralWidget_.get() != NULL)
     {
       return centralWidget_->HasUpdateContent();
@@ -339,8 +311,6 @@
 
   void WidgetViewport::UpdateContent()
   {
-    boost::mutex::scoped_lock lock(mutex_);
-
     if (centralWidget_.get() != NULL)
     {
       centralWidget_->UpdateContent();