No. The only time you get a lock is that another thread is also executing synchronizedon the same object. If your code synchronized (safeQueue), then the call PriorityBlockingQueue.poll()will be blocked only if it poll()was a method synchronizedor if the code used the synchronized (this)code.
When you call safeQueue.poll(), the code PriorityBlockingQueueactually uses internal ReentrantLockand does not execute synchronized (this). Here is the code for poll():
public E poll() {
final ReentrantLock lock = this.lock;
lock.lock();
try {
return q.poll();
} finally {
lock.unlock();
}
}
, , PriorityBlockingQueue , , . , .