Show
Ignore:
Timestamp:
08/16/10 13:38:04 (21 months ago)
Author:
robert
Message:

From Brad Christiansen,

"I have made changes in two areas that effect VPBMaster's operation. The motivation for the changes come from writing a GUI front end to VPBMaster.

The first is changes to the logging behavior:
- If a master log file is set, this is now also used as the operations log. This adds more detail to the master log file (it is clearer what has happened, particularly in the case of errors).
- Fixed a bug which meant the build log was not correctly passed to the DataSet?.

The second set of changes relate to the behavior of VPBMaster when a run is finished. Prior to my changes the VPBMaster executable would not terminate if the TaskManager? had spawned any threads, even once all tasks had completed. To change this behavior so VPBMaster would exit on completion I made two changes:

- Implemented the exit(int) function in TaskManager? (it was defined in the header but had no implementation)
- Called this method prior to VPBMaster returning from main so all thread are closed and VPBMaster exits cleanly."

Second submission:

"The return value of TaskManager?'s run method was ignored by vpbmaster, thus is the task manager failed to complete all its tasks, vpbmaster would still return 0. My change to vpbmaster checks the return value of TaskManager? run and sets the return value to 1 if the run method returns false."

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/vpb/TaskManager.cpp

    r998 r1017  
    242242    while (arguments.read("--master-log",logFileName)) 
    243243    { 
    244         setBuildLog(new BuildLog(logFileName)); 
     244        BuildLog* bl = new BuildLog(logFileName); 
     245        setBuildLog(bl); 
     246        pushOperationLog(bl); 
    245247    } 
    246248 
     
    408410        vpb::BuildOptions* bo = db ? db->getBuildOptions() : 0; 
    409411 
    410         if (bo && !(bo->getLogFileName().empty())) 
    411         { 
    412             dataset->setBuildLog(new vpb::BuildLog); 
    413         } 
     412        if (getBuildLog()) 
     413        { 
     414            dataset->setBuildLog(getBuildLog()); 
     415        } 
     416        else if (bo && !(bo->getLogFileName().empty())) 
     417        { 
     418            dataset->setBuildLog(new vpb::BuildLog(bo->getLogFileName())); 
     419        } 
     420         
    414421 
    415422        if (_taskFile.valid()) 
     
    10181025} 
    10191026 
     1027void TaskManager::exit(int sig) 
     1028{ 
     1029    handleSignal(sig); 
     1030    setDone(true); 
     1031} 
     1032 
    10201033void TaskManager::handleSignal(int sig) 
    10211034{