0

There are a total of A, B, and C threads, and A and B are threads that call back and receive data signals.

I want to implement a thread running and stop immediately based on receiving signal data.

  1. If data is number 1, run C thread
  2. If the data is number 2, immediately abort the C thread. (C thread 1 loop takes about 1 minute)

I want to implement a thread that can repeatedly perform steps 1 and 2 above. (signal variable receives button signal through mobile phone)

What should I do?

c = threading.Thread(target=test.main)

def call_back(signal):
    if signal == 1:
        c.start()  # start
    elif signal == 2:
        c.join()  # stop
jthulhu
  • 7,223
  • 2
  • 16
  • 33
hhh
  • 1
  • 1

0 Answers0