擅长:python、mysql、java
<ol>
<li>我不熟悉您似乎在GpsPoller类中使用的gps模块,以及它是否支持对其进行轮询(检查是否存在fileno属性)。然而,假设它没有,我能提供的最好的方法就是忙碌地等待,直到值设置好</li>
</ol>
<p>比如:</p>
<pre><code>while True:
if self._lat is None:
self._lat = self._gpsp.get_gps_data()
elif self._lon is None:
self._lon = self._gpsp.get_gps_data()
else:
break
</code></pre>
<ol start=“2”>
<li>确保线程与父进程一起消亡的最佳方法是执行您已经完成的操作,并将布尔值与其主循环相关联(主循环可以设置为False),从而在线程应该终止时中断循环。我假设您缺少的是一个调用,当您的AirStation类关闭时,将gpsPoller的running属性设置为False。在</li>
</ol>