starvation in pthread_once?

Alexander Terekhov TEREKHOV@de.ibm.com
Tue Mar 8 09:56:00 GMT 2005


> DCSI-TLS: (__declspec(thread) for control variable; DLL issues
> aside for a moment)
>
>   if (!once_control) {
>     named_mutex::guard guard(&once_control);
>     if (!once_control) {
>       <init>
>       once_control = true;
>     }
>   }

Sorry, I meant:

  if (!once_control) {
    named_mutex::guard guard(&once_control);
    if (!once_control2) {
      <init>
      once_control2 = true;
    }
    once_control = true;
  }

where once_control2 is a non-TLS flag.

regards,
alexander.




More information about the Pthreads-win32 mailing list