Skip to content

Commit

Permalink
resolved problem with new Thread subclass contstructor pointcut
Browse files Browse the repository at this point in the history
  • Loading branch information
kheradmand committed Feb 6, 2015
1 parent e77f2c7 commit 9cbd912
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/resources/AspectJTemplate.aj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ public aspect %NAME% {

final long[] threadOrder = %THREAD_CREATION_ORDER%;
int threadOrderIndex = 0;

pointcut threadCreation(): call(java.lang.Thread+.new(..));

before(): call(java.lang.Thread+.new(*)){
before(): threadCreation() {
threadCreationLock.lock();
while (threadOrderIndex < threadOrder.length &&
threadOrder[threadOrderIndex] != Thread.currentThread().getId()){
Expand All @@ -26,7 +28,7 @@ public aspect %NAME% {
}
}

after(): call(java.lang.Thread+.new(*)){
after(): threadCreation() {
threadOrderIndex++;
threadCreated.signalAll();
threadCreationLock.unlock();
Expand Down

0 comments on commit 9cbd912

Please sign in to comment.