1
0
Fork 0

Fix up environment code for threading-enabled case, d'oh.

This commit is contained in:
jmt 2008-12-26 15:33:38 +00:00
parent 660d59a098
commit cf42cfab16

View file

@ -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 );
} }
} }