Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1493

Show
Ignore:
Timestamp:
12/09/06 16:18:37
Author:
fumanchu
Message:

2.x backport of [1126] (Made Engine.stop check Engine.state. This allows e.g. mod_python to call stop() once per thread on shutdown.)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/cherrypy-2.x/cherrypy/_cpengine.py

    r1491 r1493  
    121121    def stop(self): 
    122122        """Stop the application server engine.""" 
    123         for thread_ident, i in self.seen_threads.iteritems(): 
    124             for func in self.on_stop_thread_list: 
    125                 func(i) 
    126         self.seen_threads.clear() 
    127          
    128         for func in self.on_stop_server_list: 
    129             func() 
    130          
    131         self.state = STOPPED 
    132         cherrypy.log("CherryPy shut down", "ENGINE") 
     123        if self.state != STOPPED: 
     124            for thread_ident, i in self.seen_threads.iteritems(): 
     125                for func in self.on_stop_thread_list: 
     126                    func(i) 
     127            self.seen_threads.clear() 
     128             
     129            for func in self.on_stop_server_list: 
     130                func() 
     131             
     132            self.state = STOPPED 
     133            cherrypy.log("CherryPy shut down", "ENGINE") 
    133134     
    134135    def restart(self): 

Hosted by WebFaction

Log in as guest/cpguest to create tickets