We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BlockTask 类中的是否被唤醒标志Notify应去除static关键字,使之成为成员变量而不是类变量。目前使用static关键字,导致标志位Notify被修改一次变成true后,其他新生成的BlockTask对象的标志位Notify都是true.
The text was updated successfully, but these errors were encountered:
有测试过吗,我认为static 关键字只是存放在方法区的全局变量,是可以进行修改的
Sorry, something went wrong.
我在使用过程就是遇到这个问题,第一次new出的BlockTask对象Notify属性为false,后面所有new 出的BlockTask对象Notify属性都为true。因为使用了一次signal()方法后,就将静态的Notify属性修改为true了,后面生成的BlockTask对象Notify属性都默认为true了。而且BlockTask是作为对象被使用的,Notify属性应该作为成员变量来使用而不是类变量来使用。
bug,修护,我仔细对比了生产环境的代码,确实是没有static修饰的
No branches or pull requests
BlockTask 类中的是否被唤醒标志Notify应去除static关键字,使之成为成员变量而不是类变量。目前使用static关键字,导致标志位Notify被修改一次变成true后,其他新生成的BlockTask对象的标志位Notify都是true.
The text was updated successfully, but these errors were encountered: