From e77f2c7e4f785d759c3cfc0b3cce025386c60604 Mon Sep 17 00:00:00 2001 From: kheradmand Date: Thu, 5 Feb 2015 20:29:27 -0600 Subject: [PATCH] support for subclass of thread buggy though --- src/main/resources/AspectJTemplate.aj | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/main/resources/AspectJTemplate.aj b/src/main/resources/AspectJTemplate.aj index 25cf564..32ab367 100644 --- a/src/main/resources/AspectJTemplate.aj +++ b/src/main/resources/AspectJTemplate.aj @@ -1,4 +1,7 @@ -import java.util.concurrent.locks; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; +import java.util.concurrent.locks.Condition; + public aspect %NAME% { @@ -11,21 +14,21 @@ public aspect %NAME% { final long[] threadOrder = %THREAD_CREATION_ORDER%; int threadOrderIndex = 0; - before(): call(java.lang.Thread.new(*)){ + before(): call(java.lang.Thread+.new(*)){ threadCreationLock.lock(); while (threadOrderIndex < threadOrder.length && threadOrder[threadOrderIndex] != Thread.currentThread().getId()){ try{ - threadCreated.await() + threadCreated.await(); }catch (InterruptedException e){ } } } - after(): call(java.lang.Thread.new(*)){ - threadOrderIndex++ - headMatched.signalAll() + after(): call(java.lang.Thread+.new(*)){ + threadOrderIndex++; + threadCreated.signalAll(); threadCreationLock.unlock(); } @@ -37,7 +40,7 @@ public aspect %NAME% { //pointcut sharedVarSet(): %SHARED_VAR_SET% - pointcut shareVarAccess(): %SHARED_VAR_ACCESS%; + pointcut sharedVarAccess(): %SHARED_VAR_ACCESS%; //sharedVarGet() || sharedVarSet() //==============================shared var end============================= @@ -54,7 +57,7 @@ public aspect %NAME% { enforceSchedule(); } - after(): afterPointcuts() &7 !cflow(adviceexecution()){ + after(): afterSync() && !cflow(adviceexecution()){ enforceSchedule(); }