title: Need Thread To Block Next Code Line But Not Other Threads
body: <p>I have a method that uses a thread to connect to my database to check if the user exists on the database. I have another thread that is responsible to update the GUI. I need the database thread to block the code that comes after it until it terminates, but not to block the GUI thread. How do I manage to do that? </p>
  
  <p>I've Tried using the join command, but it blocks the GUI thread. And I've tried using a loop that does nothing until the database thread is not alive, but it blocks too. </p>
  
  <pre><code>#GUI Thread
  self.guiThread = threading.Thread(group= None, target=self.guiLoop)
  self.guiThread.start()
  
  #GUI Method
  def guiLoop(self):
      while True:
          self.Update()
  
  #Login Button Method
  def onLoginButtonClick(self, event):
      id = self.idBox.GetValue()
      self.idBox.SetValue("")
      password = self.passwordBox.GetValue()
      self.passwordBox.SetValue("")
      self.retList = []
      self.testBool = False
      dbThread = threading.Thread(group= None, target=self.checkUser, args=(id, password, self.retList))
      dbThread.start()
      #TODO Blocking
      print (self.retList)
  
  #Database Thread Method
  def checkUser(self, id, password, retList):
      self.retList = DB.checkUser(id,password)
  </code></pre>
  
  <p>DB.checkUser is the method that checks the database if it has the user, and returns a list with user information, or an empty list if it does not have the user on the database.</p>