Java信号量是否使用忙等待或默认等待/通知?

Faq*_*aqa 5 java multithreading semaphore

问题是这样的.我在Windows 7上使用JDK 6.0,并尝试使用信号量作为解决同步问题的机制.它工作得很好,但我试图避免忙于等待我的问题.

我只想问一下java文档并省去了麻烦,但文档是这样的:

Acquires the given number of permits from this semaphore,
 blocking until all are available, or the thread is interrupted.

Acquires the given number of permits, if they are available,
 and returns immediately, reducing the number of available permits
 by the given amount.

If insufficient permits are available then the current thread
 becomes disabled for thread scheduling purposes and lies dormant
Run Code Online (Sandbox Code Playgroud)

http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/Semaphore.html#acquire(int)

也就是说,文档似乎暗示了两个答案.哪一个是正确的?

Tud*_*dor 0

由于这一行,它显然是等待/通知:

如果没有足够的许可,则当前线程将出于线程调度目的而被禁用并处于休眠状态。

这意味着操作系统不会调度线程,直到发生唤醒线程的事件(可用信号量允许),此时线程收到继续执行的信号。