I was wondering... this code is valid to avoid excessive use of
synchronized code? I think so, but we never know :-)
  This is the default getInstance() method of a singleton (simplified):

public Object getInstance()
{
  if (INSTANCE == null)
  {
    synchronized (this)
    {
      if (INSTANCE == null)
      {
        INSTANCE = this.getClass().newInstance();
      }
    }
  }
  return INSTANCE;
}

-- 

Felipe Schnack
Analista de Sistemas
[EMAIL PROTECTED]
Cel.: (51)91287530
Linux Counter #281893

Centro Universitário Ritter dos Reis
http://www.ritterdosreis.br
[EMAIL PROTECTED]
Fone/Fax.: (51)32303341


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to