host: remove deprecated setName usage

As of Python3.10, setName has been deprecated in favor of using name directly as a property
This commit is contained in:
Grant Meyerhoff 2025-01-03 14:48:10 -06:00 committed by Jörg Hofrichter
parent e40121441e
commit 5ededca7db
2 changed files with 4 additions and 5 deletions

View file

@ -468,10 +468,10 @@ def main():
rx_thread = threading.Thread(
target=benchmark_rx_rate,
args=(usrp, rx_streamer, args.random, quit_event, rx_statistics),
name="bmark_rx_stream",
)
threads.append(rx_thread)
rx_thread.start()
rx_thread.setName("bmark_rx_stream")
# Create a dictionary for the RX statistics
# Note: we're going to use this without locks, so don't access it from the main thread until
@ -488,18 +488,18 @@ def main():
tx_thread = threading.Thread(
target=benchmark_tx_rate,
args=(usrp, tx_streamer, args.random, quit_event, tx_statistics),
name="bmark_tx_stream",
)
threads.append(tx_thread)
tx_thread.start()
tx_thread.setName("bmark_tx_stream")
tx_async_thread = threading.Thread(
target=benchmark_tx_rate_async_helper,
args=(tx_streamer, quit_event, tx_async_statistics),
name="bmark_tx_helper",
)
threads.append(tx_async_thread)
tx_async_thread.start()
tx_async_thread.setName("bmark_tx_helper")
# Sleep for the required duration
# If we have a multichannel test, add some time for initialization

View file

@ -32,9 +32,8 @@ class WaveformGenerator:
if not self._streamer:
raise RuntimeError("No streamer defined!")
self._run = True
self._thread = threading.Thread(target=self._worker)
self._thread = threading.Thread(target=self._worker, name="cal_tx")
self._thread.start()
self._thread.setName("cal_tx")
def stop(self):
"""Stop the transmitter."""