0

My program contains the line:

 makecontext( &threadList[ numThreads ].context, (void (*)(void)) &threadStart, 1, 5);

Where threadStart() is defined as:

      static void threadStart(int x){
      printf("Yes! Yes! %d\n", x);
 }

I thought this should result in the display of "Yes! Yes! 5", but this does not happen. I'm not sure what is happening. I know the line is running, since I have a print statement just below it. Any help is appreciated.

Rachid K.
  • 4,490
  • 3
  • 11
  • 30
Aperson123
  • 129
  • 6

1 Answers1

1

The function is only called when the context gets activated by setcontext() or swapcontext()

makecontext(3)

Swordfish
  • 12,971
  • 3
  • 21
  • 43