Replace deprecated threading methods (#15615)
Summary of the issue:
Running Python 3.11 build, there are deprecation DEBUGWARNING's related to threading package.
From Python 3.10 What's new:
The following threading methods are now deprecated:
threading.currentThread => threading.current_thread()
threading.activeCount => threading.active_count()
threading.Condition.notifyAll => threading.Condition.notify_all()
threading.Event.isSet => threading.Event.is_set()
threading.Thread.setName => threading.Thread.name
threading.thread.getName => threading.Thread.name
threading.Thread.isDaemon => threading.Thread.daemon
threading.Thread.setDaemon => threading.Thread.daemon
Among these only threading.Event.isSet and threading.Thread.setDaemon are used in NVDA's codebase.
Description of user facing changes
No more such deprecation warning in the log.
Description of development approach
Replace the deprecated methods by their replacing method or attribute.
Since all these replacement method or attribute are available in Python 3.7, this PR is opened against master and can be merged before Python 3.11 switch, in preparation.