Changeset 7468 for source/ariba/utility


Ignore:
Timestamp:
Jan 25, 2010, 10:50:57 AM (15 years ago)
Author:
Christoph Mayer
Message:

-timer delete fix (noch auskommentiert), -interface cleanup

Location:
source/ariba/utility/system
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/utility/system/SystemQueue.cpp

    r6919 r7468  
    9595}
    9696
     97void SystemQueue::dropAll( const SystemEventListener* mlistener){
     98#ifndef UNDERLAY_OMNET
     99        directScheduler.dropAll(mlistener);
     100        delayScheduler.dropAll(mlistener);
     101#endif
     102}
     103
    97104bool SystemQueue::isEmpty() {
    98105#ifndef UNDERLAY_OMNET
     
    192199}
    193200
     201void SystemQueue::QueueThread::dropAll( const SystemEventListener* mlistener) {
     202        boost::mutex::scoped_lock lock( queueMutex );
     203
     204        bool deleted = false;
     205        do{
     206                EventQueue::iterator i = eventsQueue.begin();
     207                EventQueue::iterator iend = eventsQueue.end();
     208
     209                for( ; i != iend; i++){
     210                        if((*i).getListener() == mlistener){
     211                                eventsQueue.erase(i);
     212                                deleted = true;
     213                                break;
     214                        }
     215                }
     216        }while(deleted);
     217}
     218
    194219void SystemQueue::QueueThread::threadFunc( QueueThread* obj ) {
    195220
  • source/ariba/utility/system/SystemQueue.h

    r6919 r7468  
    125125
    126126        /**
     127         * Drop all queued events for that listener
     128         */
     129        void dropAll( const SystemEventListener* mlistener);
     130
     131        /**
    127132         * Check wheter this queue has items or not.
    128133         *
     
    182187                void enter();
    183188                void leave();
     189                void dropAll( const SystemEventListener* mlistener);
    184190
    185191        protected:
  • source/ariba/utility/system/Timer.cpp

    r4987 r7468  
    100100        running = false;
    101101        reset(); // cause the sleep to abort
     102        //SystemQueue::instance().dropAll(this);
    102103}
    103104
  • source/ariba/utility/system/Timer.h

    r4987 r7468  
    4040#define __TIMER_H
    4141
     42#include <stdint.h>
    4243#include "ariba/utility/system/SystemEventListener.h"
    4344#include "ariba/utility/system/SystemQueue.h"
Note: See TracChangeset for help on using the changeset viewer.