From 9cbd9124c66bb1e716b793f3665909c94dae9105 Mon Sep 17 00:00:00 2001 From: kheradmand Date: Fri, 6 Feb 2015 13:28:40 -0600 Subject: [PATCH] resolved problem with new Thread subclass contstructor pointcut --- src/main/resources/AspectJTemplate.aj | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/resources/AspectJTemplate.aj b/src/main/resources/AspectJTemplate.aj index 32ab367..a9bbbd2 100644 --- a/src/main/resources/AspectJTemplate.aj +++ b/src/main/resources/AspectJTemplate.aj @@ -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()){ @@ -26,7 +28,7 @@ public aspect %NAME% { } } - after(): call(java.lang.Thread+.new(*)){ + after(): threadCreation() { threadOrderIndex++; threadCreated.signalAll(); threadCreationLock.unlock();