diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-06-06 10:14:14 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-06-06 10:14:14 +0000 |
commit | 2754ce81f460d4f12967cef0a17559b1d3cd649c (patch) | |
tree | b51440baca1000109ade68e8810c96e54d706828 /gcc/ada/g-tasloc.ads | |
parent | f163f79ea337476c9b935eca4b2f0a747b1eb47e (diff) | |
download | gcc-2754ce81f460d4f12967cef0a17559b1d3cd649c.tar.gz |
2007-04-20 Robert Dewar <dewar@adacore.com>
* g-string.adb, s-proinf-irix-athread.adb, s-gloloc-mingw.adb,
s-tfsetr-default.adb, gnatfind.adb, gnatxref.adb, gprep.adb,
g-regexp.adb, g-regexp.ads, g-regpat.ads, g-tasloc.adb, g-tasloc.ads,
output.adb, switch-m.ads, tree_in.ads, tree_io.ads, indepsw.ads,
g-utf_32.adb, g-utf_32.ads, a-wichun.adb, a-wichun.ads, a-zchuni.adb,
a-zchuni.ads: Replace GNAT.xxx by System.xxx when appropriate.
* s-utf_32.adb, s-utf_32.ads, s-os_lib.adb, s-os_lib.ads, s-regexp.adb,
s-regexp.ads, s-regpat.adb, s-regpat.ads, s-string.adb, s-string.ads,
s-tasloc.adb, s-tasloc.ads: New files.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125360 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/g-tasloc.ads')
-rw-r--r-- | gcc/ada/g-tasloc.ads | 56 |
1 files changed, 4 insertions, 52 deletions
diff --git a/gcc/ada/g-tasloc.ads b/gcc/ada/g-tasloc.ads index 757d3c2df93..ce49667c8b1 100644 --- a/gcc/ada/g-tasloc.ads +++ b/gcc/ada/g-tasloc.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1998-2005, AdaCore -- +-- Copyright (C) 1998-2007, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -41,56 +41,8 @@ -- These routines may be used in a non-tasking program, and in that case -- they have no effect (they do NOT cause the tasking runtime to be loaded). -package GNAT.Task_Lock is - pragma Elaborate_Body; +-- See file s-tasloc.ads for full documentation of the interface - procedure Lock; - pragma Inline (Lock); - -- Acquires the global lock, starts the execution of a critical region - -- which no other task can enter until the locking task calls Unlock +with System.Task_Lock; - procedure Unlock; - pragma Inline (Unlock); - -- Releases the global lock, allowing another task to successfully - -- complete a Lock operation. Terminates the critical region. - -- - -- The recommended protocol for using these two procedures is as - -- follows: - -- - -- Locked_Processing : begin - -- Lock; - -- ... - -- TSL.Unlock; - -- - -- exception - -- when others => - -- Unlock; - -- raise; - -- end Locked_Processing; - -- - -- This ensures that the lock is not left set if an exception is raised - -- explicitly or implicitly during the critical locked region. - -- - -- Note on multiple calls to Lock: It is permissible to call Lock - -- more than once with no intervening Unlock from a single task, - -- and the lock will not be released until the corresponding number - -- of Unlock operations has been performed. For example: - -- - -- GNAT.Task_Lock.Lock; -- acquires lock - -- GNAT.Task_Lock.Lock; -- no effect - -- GNAT.Task_Lock.Lock; -- no effect - -- GNAT.Task_Lock.Unlock; -- no effect - -- GNAT.Task_Lock.Unlock; -- no effect - -- GNAT.Task_Lock.Unlock; -- releases lock - -- - -- However, as previously noted, the Task_Lock facility should only - -- be used for very local locks where the probability of conflict is - -- low, so usually this kind of nesting is not a good idea in any case. - -- In more complex locking situations, it is more appropriate to define - -- an appropriate protected type to provide the required locking. - -- - -- It is an error to call Unlock when there has been no prior call to - -- Lock. The effect of such an erroneous call is undefined, and may - -- result in deadlock, or other malfunction of the run-time system. - -end GNAT.Task_Lock; +package GNAT.Task_Lock renames System.Task_Lock; |