AspectJ does not create threads by itself: weaving βonlyβ changes the code by introducing some additional instructions, but it continues to work in the same context.
The synchronized in a pointcut definition does nothing useful. If you want to synchronize all calls (or executions, which would mean less modified code), for methods annotated with @Synchronizes in the same lock, you need advice:
public aspect SynchronizingAspect { private static final Object lock = new Object(); pointcut syncJointPoint(): execution(@Synchronizes * *.*(..));
source share