2

我尝试使用monitorenter和monitorexite来控制声音,这是我使用的代码,但这对我不起作用这些错误显示:monitorenter无法解析为变量,monitorenter无法解析为变量,localObject无法解析为变量

 public static SoundManager getInstance()
 {
  monitorenter;
    try
    {
      if (_instance == null)
        _instance = new SoundManager();
      SoundManager localSoundManager = _instance;
      monitorexit;
      return localSoundManager;
    }
    finally
    {
      localObject = finally;
      monitorexit;
    }
    throw localObject;
}
4

0 回答 0