title: Threads with decorators
body: <p>I'm trying to implement threading(with using decorators) to my application, but can't understand some things about locks and managing threads.</p>
  
  <pre><code>import threading
  
  def run_in_thread(fn):
      def run(*k, **kw):
          t = threading.Thread(target=fn, args=k, kwargs=kw)
          t.start()
      return run
  
  class A:
      @run_in_thread
      def method1(self):
          for x in range(10000):
              print x
  
  
      @run_in_thread
      def method2(self):
          for y in list('wlkefjwfejwiefwhfwfkjshkjadgfjhkewgfjwjefjwe'):
              print y
  
      def stop_thread(self):
          pass
  
  c = A()
  c.method1()
  c.method2()
  </code></pre>
  
  <ol>
  <li><p>As I understand, method1 and method2 are not synchronized, but synchronizing of that stuff implementing with help of locks. How I can add locks to my decorator-function?</p></li>
  <li><p>How can I realize method for stopping long threads using decorators? </p></li>
  </ol>