kno*_*orv 2 java concurrency multithreading jvm semaphore
以下两个方法定义在语义上是等价的吗?为什么?为什么不?
版本A:
private static synchronized void foo() {
    bar();
}
版本B:
private static Semaphore available = new Semaphore(1, true);
private static void foo() {
    available.acquire();
    try {
        bar();
    }
    finally {
       available.release();
    }
}
是的,除了