Changeset 4483 for source/ariba/utility/system/StartupWrapper.cpp
- Timestamp:
- Jun 25, 2009, 11:06:52 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/utility/system/StartupWrapper.cpp
r4462 r4483 48 48 49 49 SystemEventType StartupWrapperEventStartup("StartupWrapperEventStartup"); 50 SystemEventType StartupWrapperEventShutdown("StartupWrapperEventShutdown");51 50 52 51 StartupWrapper::StartupWrapper(StartupInterface* _service) : service( _service ){ … … 73 72 #endif 74 73 75 void StartupWrapper::initSystem(){ 76 77 static bool initialized = false; 78 if( initialized ) return; 79 initialized = true; 74 void StartupWrapper::startSystem(){ 80 75 81 76 // … … 121 116 } 122 117 118 void StartupWrapper::stopSystem(){ 119 SystemQueue::instance().cancel(); 120 } 121 123 122 void StartupWrapper::initConfig(string filename){ 124 123 configurations.push( filename ); … … 142 141 143 142 service->startup(); 144 145 } else if( event.getType() == StartupWrapperEventShutdown ){146 147 service->shutdown();148 SystemQueue::instance().cancel();149 143 150 144 } … … 174 168 175 169 if(block){ 176 SystemEvent ev (service->wrapper, StartupWrapperEventShutdown); 177 service->wrapper->handleSystemEvent(ev); 178 170 // call directly 171 service->shutdown(); 179 172 }else{ 180 SystemQueue::instance().scheduleEvent( 181 SystemEvent( service->wrapper, StartupWrapperEventShutdown, NULL), 0 ); 173 // call async, but not using systemqueue! // TODO: mem leak 174 AsyncShutdown* async = new AsyncShutdown(service); 175 async->runBlockingMethod(); 182 176 } 183 177 } 184 178 179 StartupWrapper::AsyncShutdown::AsyncShutdown(StartupInterface* _service) 180 : service(_service){ 181 } 182 183 void StartupWrapper::AsyncShutdown::blockingFunction(){ 184 service->shutdown(); 185 } 186 187 void StartupWrapper::AsyncShutdown::dispatchFunction(){ 188 //unused 189 } 190 185 191 }} // namespace ariba, utility
Note:
See TracChangeset
for help on using the changeset viewer.