Commit 1c48823d authored by Marco De Marco's avatar Marco De Marco
Browse files

EventThread and WorkingThread fix

parent d6b2dbfe
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
#================================================================================
EXEC_NAME=fitsImporter-srv
INST_NAME=test
DEBUG_LEV=-v4
DEBUG_LEV=-v7
#================================================================================
INC_DIR=/usr/local/omniORB-4.1.7/include \
	   /usr/local/zeromq-3.2.3/include/zmq \
+5 −4
Original line number Diff line number Diff line
@@ -75,15 +75,15 @@ boost::filesystem::path EventBuffer::waitNew()
		{
			if(it->second == false)
			{
                DEBUG_STREAM << "EventBuffer::insertNew(): "
                    "found new element: " << it->first.string() << endl;                 
                DEBUG_STREAM << "EventBuffer::insertNew() found new element:"
                    << it->first.string() << endl;                 
                
				it->second = true;
				return it->first;
			}
		}

        DEBUG_STREAM << "EventBuffer::waitNew(): waiting new element" << endl;
        DEBUG_STREAM << "EventBuffer::waitNew() waiting new element" << endl;

		m_conditionVariable.wait(lock);
	}
@@ -105,13 +105,14 @@ void EventBuffer::removeProcessed(boost::filesystem::path path)

	if(it != m_buffer.end())
    {
        if(it->second != false)
        if(it->second == true)
        {
            m_buffer.erase(it);

            DEBUG_STREAM << "EventBuffer::removeProcessed() element "
                << path.string() << " removed" << endl;
        }
        else
            ERROR_STREAM << "EventBuffer::removeProcessed() element" 
                << path.string() << " to remove not processed" << endl;    
    }
+12 −12
Original line number Diff line number Diff line
@@ -261,6 +261,7 @@ void EventThread::eventLoop()

                boost::mutex::scoped_lock statusLock(m_statusMutex);    
                m_status = "Event thread new data found";                
            }
            
            struct inotify_event *event;
            for(int i=0; i<length; i += EVENT_SIZE + event->len)
@@ -275,7 +276,6 @@ void EventThread::eventLoop()
                if(boost::filesystem::is_regular_file(path))
                    m_eventBuffer_sp->insertNew(path);
            }
            }
		
            DEBUG_STREAM << "EventThread::eventLoop() sleep for " << sleepTime << endl;
            
+2 −2
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ private:
    static const unsigned int MAX_CONNECTION_NUMBER = 10;

    //Min milli second of sleep time allowed
    static const unsigned long MIN_SLEEP_TIME = 0;    
    static const unsigned long MIN_SLEEP_TIME = 100;    
    
    //Max milli second of sleep time allowed
    static const unsigned long MAX_SLEEP_TIME = 10000;    
@@ -105,7 +105,7 @@ private:
    static const unsigned long MAX_WAIT_TIME = 10000; 

    //Min port number allowed value
    static const unsigned long MIN_DMDB_PORT = 0;    
    static const unsigned long MIN_DMDB_PORT = 1;    
    
    //Max port number allowed value
    static const unsigned long MAX_DMDB_PORT = 65535;     
+1 −1
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@
    <deviceProperties name="SleepTime" description="Time fits importer event loop has to sleep before check for new file">
      <type xsi:type="pogoDsl:UIntType"/>
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
      <DefaultPropValue>1</DefaultPropValue>
      <DefaultPropValue>1000</DefaultPropValue>
    </deviceProperties>
    <deviceProperties name="WaitTime" description="Time fits importer has to sleep between new time event and ingestion">
      <type xsi:type="pogoDsl:UIntType"/>
Loading