This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Lock_Free implementation for protected object


This patch reorganizes the Lock_Free restrictions. The compiler issues a
warning whenever a Priority aspect/pragma is given while the lock-free
implementation has been forced by an aspect/pragma.

------------
-- Source --
------------

package T is
   protected type P1
     with Lock_Free
   is
      pragma Priority (1);
   end P1;
end T;

-----------------
-- Compilation --
-----------------

gnatmake -q -gnat12 t.ads

------------
-- Output --
------------

t.ads:5:07: warning: pragma "Priority" for "P1" has no effect when Lock_Free given
gnatmake: "t.ads" compilation error

Tested on x86_64-pc-linux-gnu, committed on trunk

2012-07-09  Vincent Pucci  <pucci@adacore.com>

	* sem_ch9.adb (Allows_Lock_Free_Implementation): type must support
	atomic operation moved to the protected body case. No non-elementary
	out parameter moved to the protected declaration case. Functions have
	only one lock-free restriction.
	(Analyze_Protected_Type_Declaration): Issue a warning when
	Priority given with Lock_Free.

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]