[omniORB] Lockup on Solaris 2.5.1 with Y2K patch

David.Chung@USPTO.GOV David.Chung@USPTO.GOV
Tue, 22 Jun 1999 08:15:09 -0400


	These days, many systems have 4-byte reads as atomic, and it does
not need
mutex protection against dirty reads.


> -----Original Message-----
> From:	harald.hopfes@vs.dasa.de [SMTP:harald.hopfes@vs.dasa.de]
> Sent:	Tuesday, June 22, 1999 4:17 AM
> To:	omniorb-list@uk.research.att.com
> Subject:	Re: [omniORB] Lockup on Solaris 2.5.1 with Y2K patch
> 
> Hi!
> 
> You protect the variable "int died" only in the "killer" thread against
> mutual
> access. In the worker
> thread it isn't protected!
> 
> The code
> 
>   while (!died) {
> 
> should be rewritten to
> 
>   while (1) {
>      pthread_mutex_lock(&mutex);
>      if (died) {
>           pthread_mutex_unlock(&mutex);
>           break;
>      }
>      pthread_mutex_unlock(&mutex);
> 
> Harald
> 
>