title: Is there a way to stop other service when get a particular request
body: <p>I'm making a face recognition python API by flask.
  I need a way to make all service pause when get a particular request.
  After finish that particular request resume all service.</p>
  
  <p>My development environment:
  Python 3.5
  Flask 1.02</p>
  
  <p>I make two function, one recognize face ,another update face data.
  A list store all face data using by recognize face function.
  Send a request to change face data while recognizing face will cause an error and crash.</p>
  
  <p>Therefore, I need a way to stop face recognition function when get update request , after finish update function resume all face recognition request.</p>
  
  <pre class="lang-py prettyprint-override"><code>app = Flask(__name__)
  
  # face recognition
  @app.route('/A', methods=['POST'])
  def jobA():
      data = request.get_json()
      ###fuction of face recognition 
      result = recognition(data)
      return jsonify({"result": result})
  
  
  # update face data
  @app.route('/B', methods=['POST'])
  def jobB():
      data = request.get_json()
      ###fuction of update face data
      result = update(data)
      return jsonify({"result": result})
  
  if __name__ == '__main__':
      app.run(host='0.0.0.0', debug=False)
  </code></pre>
  
  <p>when doing update and recognize in same time will crash.
  there is the error messages :
  Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)</p>