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)


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







Back to the top