コード例 #1
0
ファイル: finalCalc.c プロジェクト: Pitxyoki/Cheetah
void resultAvailable (int jobID) {
  pthread_mutex_lock(&end_mutex);
  if (jobID < 0) {
    Job tmpJob;
    tmpJob.jobID = jobID;
    tmpJob.returnTo = defaultRCID;
    JobResults *jr = getResults(&tmpJob);
    printf("JM  (%i): got profiling result number %i\n", myid, jobID);
    deleteResults(jr);
    printf("JM  (%i): deleted profiling result number %i.\n", myid, jobID);
    profilesReceived++;
    pthread_cond_signal(&profile_over);
    pthread_mutex_unlock(&end_mutex);
    return;
  }
//  printf("JM  (%i): jobID %i's results arrived. GONNA FETCH'EM.\n", myid, jobID);

  jobRes[jobID] = getResults(job[jobID]);


//  printf("JM  (%i): jobID %i's results fetched. Job %s (%i).\n", myid, jobID,
//      jobRes[jobID]->returnStatus == JOB_RETURN_STATUS_FAILURE ? "FAILED to execute" : "executed successfully",
//      jobRes[jobID]->returnStatus);

  if (jobRes[jobID]->returnStatus == JOB_RETURN_STATUS_FAILURE)
    exit (EXIT_FAILURE);


  nArrivals++;
  pthread_mutex_unlock(&end_mutex);

  if (nArrivals == NJOBS)
    savePic();
}
コード例 #2
0
ファイル: widget.cpp プロジェクト: vikkiorrikki/Colorist
void Widget::on_btnSavePic_clicked()
{
    savePic();
}