Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] Execution joinpoint and synchronization

Hi Oyse,

I tested this a while ago and the execution join point is in the cflow of
(i.e., inside, after, within) the synchronization block. The VM synchronizes
before letting any code in the method run. I.e., advice on the join point
runs after the lock is acquired. If you want to advise the method outside of
synchronization, you could advise the call join point in some cases.

In addition, if you advise a method that has synchronized(this) { ... } for
its body, the execution join point is outside the synchronization.

-----Original Message-----
From: aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of oyse
Sent: Saturday, March 18, 2006 7:11 AM
To: aspectj-users@xxxxxxxxxxx
Subject: [aspectj-users] Execution joinpoint and synchronization


Hi

I was wondering if anyone knows the exact semantics of the execution
pointcut when used on synchronized methods? At what point does the
synchronization take place related to the advice and the join point?

For instance in the following example has the synchronization taken place
before the advice is executed and is the monitor lock released after
proceed() returns or after the advice returns?

pointcut test_execution() : execution( * examples.Test.test(..) );

Object around() : test_execution(){

    //some code

   returnValue = proceed();

   //some code
   return returnValue;

}

Any help is greatly appreciated.

- oyse

--
View this message in context:
http://www.nabble.com/Execution-joinpoint-and-synchronization-t1303145.html#
a3471954
Sent from the AspectJ - users forum at Nabble.com.

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users




Back to the top