Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Changing the thread functions to have the proper C11 signature

...

Code Block
bgColor#ffcccc
langc
extern int compute(void*);

static _Bool end_processing;

void*int thread_func(void *arg) {
  while (0 == *(volatile _Bool*)&end_processing) {
    int status;
    status = compute(arg);
    if (status) {
      /* notify other threads to end processing */
      end_processing = 1;
      break;
    }
  }
  return 0;
}

...

Code Block
bgColor#ccccff
langc
extern int compute(void*);

static volatile _Bool end_processing;

void*int thread_func(void *arg) {
  while (0 == end_processing) {
    int status;
    status = compute(arg);
    if (status) {
      /* notify other threads to end processing */
      end_processing = 1;
      break;
    }
  }
  return 0;
}

...