Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@synchronized(lock)
def _stopQueueProcessorThread(self):
""" Stop thread for processing the mail queue.
"""
key = self._getThreadKey()
if queue_threads.has_key(key):
thread = queue_threads[key]
thread.stop()
while thread.isAlive():
# wait until thread is really dead
time.sleep(0.3)
del queue_threads[key]
LOG.info('Thread for %s stopped' % key)
@synchronized(lock)
def _stopQueueProcessorThread(self):
""" Stop thread for processing the mail queue """
key = self._getThreadKey()
if queue_threads.has_key(key):
thread = queue_threads[key]
thread.stop()
while thread.isAlive():
# wait until thread is really dead
time.sleep(0.3)
del queue_threads[path]
LOG.info('Thread for %s stopped' % key)
@synchronized(lock)
def _startQueueProcessorThread(self):
""" Start thread for processing the mail queue.
"""
key = self._getThreadKey()
if not queue_threads.has_key(key):
thread = QueueProcessorThread()
thread.setMailer(self._makeMailer())
thread.setQueuePath(self.smtp_queue_directory)
thread.start()
queue_threads[key] = thread
LOG.info('Thread for %s started' % key)
@synchronized(lock)
def _startQueueProcessorThread(self):
""" Start thread for processing the mail queue
"""
key = self._getThreadKey()
if not queue_threads.has_key(key):
thread = QueueProcessorThread()
thread.setMailer(self._makeMailer())
thread.setQueuePath(self.smtp_queue_directory)
thread.start()
queue_threads[key] = thread
LOG.info('Thread for %s started' % key)