Fix up environment code for threading-enabled case, d'oh.
This commit is contained in:
parent
660d59a098
commit
cf42cfab16
1 changed files with 5 additions and 5 deletions
|
@ -964,7 +964,7 @@ FGMetarEnvironmentCtrl::update_metar_properties( const FGMetar *m )
|
||||||
void
|
void
|
||||||
FGMetarEnvironmentCtrl::thread_stop()
|
FGMetarEnvironmentCtrl::thread_stop()
|
||||||
{
|
{
|
||||||
request_queue.push( string() ); // ask thread to terminate
|
request_queue.push(NULL); // ask thread to terminate
|
||||||
thread->join();
|
thread->join();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -973,11 +973,11 @@ FGMetarEnvironmentCtrl::MetarThread::run()
|
||||||
{
|
{
|
||||||
while ( true )
|
while ( true )
|
||||||
{
|
{
|
||||||
string icao = fetcher->request_queue.pop();
|
FGAirport* apt = fetcher->request_queue.pop();
|
||||||
if (icao.empty())
|
if (!apt)
|
||||||
return;
|
return;
|
||||||
SG_LOG( SG_GENERAL, SG_INFO, "Thread: fetch metar data = " << icao );
|
SG_LOG( SG_GENERAL, SG_INFO, "Thread: fetch metar data = " << apt->ident() );
|
||||||
FGMetarResult result = fetcher->fetch_data( icao );
|
FGMetarResult result = fetcher->fetch_data( apt );
|
||||||
fetcher->result_queue.push( result );
|
fetcher->result_queue.push( result );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue