Changeset 10488 for trunk


Ignore:
Timestamp:
04/29/11 09:48:57 (14 years ago)
Author:
tbretz
Message:
EXIT command was ignored when running in a shell - fixed.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/dataLogger.cc

    r10474 r10488  
    14331433}
    14341434
     1435void RunThread(DataLogger *logger)
     1436{
     1437    // This is necessary so that the StateMachien Thread can signal the
     1438    // Readline thread to exit
     1439    logger->Run(true);
     1440    Readline::Stop();
     1441}
     1442
    14351443template<class T>
    14361444int RunShell(Configuration &conf)
     
    14461454
    14471455    DataLogger logger(wout);
    1448 
    14491456    shell.SetReceiver(logger);
    14501457
    1451     logger.SetReady();
    1452 
    1453     shell.Run();                 // Run the shell
    1454      logger.SetNotReady();
     1458    boost::thread t(boost::bind(RunThread, &logger));
     1459
     1460    shell.Run();    // Run the shell
     1461
     1462    logger.Stop();  // Signal Loop-thread to stop
     1463
     1464    // Wait until the StateMachine has finished its thread
     1465    // before returning and destroying the dim objects which might
     1466    // still be in use.
     1467    t.join();
    14551468
    14561469    return 0;
Note: See TracChangeset for help on using the changeset viewer.