예제 #1
0
static void* do_worker_routine(void* args) {

  Process* proc = ((Process*) args);

  sem_wait(&proc->milestone);
  sem_wait(&proc->milestone);

  do_thread_job(proc);

  pthread_mutex_lock(&proc->mutex_lock);
  if(proc->time_elapsed <= proc->deadline){
    proc->step = PROCESSED;
  } else {
    proc->step = FAILED;
  }
  pthread_mutex_unlock(&proc->mutex_lock);

  notify_finished_worker_exec_and_write_ouput(proc->name, proc->time_elapsed, proc->time_elapsed - proc->t0);
  return NULL;
}
예제 #2
0
static void *
thread_handler(void *arg)
{
    do_thread_job((mb_btreplay_thread_arg_t *) arg);
    return NULL;
}