PR_AtomicIncrement(&g_InstanceCount);
nsOS2Charset::nsOS2Charset(){  NS_INIT_REFCNT();  PR_AtomicIncrement(&g_InstanceCount);  PR_AtomicIncrement(&gCnt); // count for gInfo  // XXX We should make the following block critical section  if(nsnull == gInfo)  {     nsAutoString propertyURL; propertyURL.AssignWithConversion("resource:/res/os2charset.properties");     nsURLProperties *info = new nsURLProperties( propertyURL );     NS_ASSERTION( info , " cannot create nsURLProperties");     gInfo = info;  }  NS_ASSERTION(gInfo, "Cannot open property file");  if( gInfo )   {    UINT acp = ::WinQueryCp(HMQ_CURRENT);    PRInt32 acpint = (PRInt32)(acp & 0x00FFFF);    nsAutoString acpKey; acpKey.AssignWithConversion("os2.");    acpKey.AppendInt(acpint, 10);    nsresult res = gInfo->Get(acpKey, mCharset);    if(NS_FAILED(res)) {      mCharset.AssignWithConversion("IBM850");    }  } else {    mCharset.AssignWithConversion("IBM850");  }}