private void SetMessageID(System.IO.StreamWriter infoStream) { lock (this) { if (infoStream != null && messageID == - 1) { lock (MESSAGE_ID_LOCK) { messageID = MESSAGE_ID++; } } this.infoStream = infoStream; } }