⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 synchronizedbytecodebug.groovy

📁 大名鼎鼎的java动态脚本语言。已经通过了sun的认证
💻 GROOVY
字号:
/** * @author Guillaume Laforge */class SynchronizedBytecodeBug extends GroovyTestCase {    /**     * Groovy's bytecode associated with syncrhonized(foo) construct used to generate invalid bytecode     * This test method shows that the standard wait()/notify() works.     */    void testSynchronized() {        Integer foo = 0        Thread.start{            println "sleeping for a moment"            sleep 1000            println "slept and synchronizing from thread"            synchronized(foo) {                println "notifying"                foo.notify()                println "notified"            }        }        println "synchronizing"        synchronized(foo) {            println "starting to wait"            foo.wait()            println "waited"        }        // if this point is reached, the test worked :-)        assert true    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -