This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: method after() and afer_idle() are not thread save
Type: Stage:
Components: Tkinter Versions: Python 2.3
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: loewis Nosy List: gpolo, loewis, thaar
Priority: normal Keywords:

Created on 2004-07-22 13:48 by thaar, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg21752 - (view) Author: Tobias Haar (thaar) Date: 2004-07-22 13:48
The methods afer() and after_idle() register the
callback function in the list self._tclCommands. This
List is member of the Misc class in the file tkinter.py
and is not protected by a lock. 
So it could be that the thread  access the list by
calling the function after() and to the same time the
tkinter mainloop access the list  by the methode
deletecommand() in the callback function.  The same
problem will occur if the function after() is called by
two theads.

solution: 
Create a lock object and save the list 
self._tclCommands in the methods :

misc.destroy()
misc.deletecommand()
misc._register()
msg78637 - (view) Author: Guilherme Polo (gpolo) * (Python committer) Date: 2008-12-31 17:24
This is not going to happen.
You should be protecting it yourself since this is a special case.
History
Date User Action Args
2022-04-11 14:56:05adminsetgithub: 40620
2008-12-31 17:24:33gpolosetstatus: open -> closed
nosy: + gpolo
resolution: wont fix
messages: + msg78637
2004-07-22 13:48:54thaarcreate