David,
The lock will be that of the inner object only. Even though an inner class cannot be instantiated without an enclosing instance, the outer and inner instances are separate objects. They each have their own lock, and their locks are not associated.
With that said, I note that your example will not compile. Class A implements Runnable, but does not define run(), and so must be made abstract. Further, you cannot construct a
Thread by passing an instance of A.B to its constructor - B is not a Runnable.
Jerry