1

I have overrriden the .join() method when creating a subclass of threading.Thread(). When I test my class with a test script it works fine, however when using it in my program the thread.join) method is being called over and over but its not me doing it. What is calling this method? No exception are being thrown as far as i can tell. using inspect the calling functions seems to be _exitfunc but I cant find any info on this.

My code is to long to post but can be found here

T_Mac
  • 223
  • 3
  • 10

2 Answers2

1

If the calling function is _exitfunc that means that the join method is being called at program termination. That is to be expected because the Python threading framework does call join on all running non-daemon threads as part of program termination.

The best explanation of _exitfunc is another Stack Overflow question: What is a python thread

Community
  • 1
  • 1
David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
0

If you don't want join() to be called when program exits, make the thread a daemon:

t.daemon = True

Non-daemon threads will keep the process running until they all die.

bereal
  • 32,519
  • 6
  • 58
  • 104