Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] advice matching the synchronized method shadow ... will be executed outside the lock rather than inside (compiler limitation)

Thanks a low Matthew, I now understood at least what's going on.

Eric

On 10/04/07, Matthew Webster < matthew_webster@xxxxxxxxxx> wrote:

Eric,

I think I now understand your problem. When -Xjoinpoints:synchronization is used you get a warning for every synchronized method matched by execution() rather than just those that have actually been transformed due to a matching lock/unlock() pointcut. Fortunately this is an Xlint warning so you can switch it off. Please read the design notes for https://bugs.eclipse.org/bugs/show_bug.cgi?id=123759.

Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM United Kingdom Limited
Hursley Park, Winchester,  SO21 2JN, England
Telephone: +44 196 2816139 (external) 246139 (internal)



"Eric Bodden" <eric.bodden@xxxxxxxxxxxxxx>
Sent by: aspectj-users-bounces@xxxxxxxxxxx

04/04/2007 16:02

Please respond to
aspectj-users@xxxxxxxxxxx

To
aspectj-users@xxxxxxxxxxx
cc

Subject
Re: [aspectj-users] advice matching the synchronized method shadow        ... will be executed outside the lock rather than inside        (compiler limitation)







But my question was why the transformation is done at all.

In my understanding, execution(synchronized *.*(..)) matches all synchronized methods, i.e. shadows should be woven just inside those methods, as usual for execution-joinpoints. Then, the lock/unlock pointcuts match on sychronized blocks (but not synchronized methods, right?), which is something entirely different. But also for those, I do not see why you would need any transformation.

Cheers,
Eric

On 04/04/07, Matthew Webster <matthew_webster@xxxxxxxxxx > wrote:

Eric,


       before () : lock() {}


The (current) limitation exists because of the need to change the weave to (reliably) put method execution advice _inside_ the synchronized block but only when that block is the result of a prior transformation!


Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM United Kingdom Limited
Hursley Park, Winchester,  SO21 2JN, England
Telephone: +44 196 2816139 (external) 246139 (internal)


"Eric Bodden" <eric.bodden@xxxxxxxxxxxxxx >
Sent by:
aspectj-users-bounces@xxxxxxxxxxx

03/04/2007 22:49

Please respond to
aspectj-users@xxxxxxxxxxx


To
aspectj-users@xxxxxxxxxxx
cc

Subject
Re: [aspectj-users] advice matching the synchronized method shadow        ... will be executed outside the lock rather than inside        (compiler limitation)









Thanks, Matthew, for the comment. However, I don't quite understand. Why should it be necessary to do this transformation? Why can't you not just insert the proper advice body call into the body of the synchronized method. (That's what abc does and it never seemed to cause any problems.) It would be great if that could be clarified.

Cheers,
Eric

On 03/04/07, Matthew Webster <
matthew_webster@xxxxxxxxxx > wrote:

Eric,


Please read Bug 123759 "expose join points for synchronized methods/blocks and define new related pointcuts". Essentially to advise a synchronized method we must transform it into a non-synchronized method with a synchronized block. However the existing execution() pointcut matching means that the method execution join point will occur before the lock rather than after (as it should do).


Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM United Kingdom Limited
Hursley Park, Winchester,  SO21 2JN, England
Telephone: +44 196 2816139 (external) 246139 (internal)

"Eric Bodden" <eric.bodden@xxxxxxxxxxxxxx >
Sent by:
aspectj-users-bounces@xxxxxxxxxxx

28/03/2007 15:38

Please respond to
aspectj-users@xxxxxxxxxxx


To
aspectj-users@xxxxxxxxxxx
cc

Subject
[aspectj-users] advice matching the synchronized method shadow ...        will be executed outside the lock rather than inside        (compiler limitation)











Hi all.

ajc is giving me this compiler warning:

advice matching the synchronized method shadow <some method name here>
will be executed outside the lock rather than inside (compiler
limitation)

What does this mean? When ajc injects code into the body of a
synchronized method, is this code then not automatically guarded by
the lock that is assigned when this method is entered? Could somebody
clarify the semantics of that message for me?

Cheers,
Eric

--
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada

_______________________________________________
aspectj-users mailing list

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





Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU





_______________________________________________
aspectj-users mailing list

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




--
Eric Bodden
Sable Research Group

McGill University, Montréal, Canada _______________________________________________
aspectj-users mailing list

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






Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU






_______________________________________________
aspectj-users mailing list

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




--
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users







Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU







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




--
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada

Back to the top