home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / adav313.zip / gnat-3_13p-os2-bin-20010916.zip / emx / gnatlib / s-tasque.ads < prev    next >
Text File  |  2000-07-19  |  5KB  |  103 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS               --
  4. --                                                                          --
  5. --                 S Y S T E M . T A S K I N G . Q U E U I N G              --
  6. --                                                                          --
  7. --                                  S p e c                                 --
  8. --                                                                          --
  9. --                             $Revision: 1.21 $
  10. --                                                                          --
  11. --             Copyright (C) 1991-1998 Florida State University             --
  12. --                                                                          --
  13. -- GNARL is free software; you can  redistribute it  and/or modify it under --
  14. -- terms of the  GNU General Public License as published  by the Free Soft- --
  15. -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
  16. -- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
  17. -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  18. -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
  19. -- for  more details.  You should have  received  a copy of the GNU General --
  20. -- Public License  distributed with GNARL; see file COPYING.  If not, write --
  21. -- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
  22. -- MA 02111-1307, USA.                                                      --
  23. --                                                                          --
  24. -- As a special exception,  if other files  instantiate  generics from this --
  25. -- unit, or you link  this unit with other files  to produce an executable, --
  26. -- this  unit  does not  by itself cause  the resulting  executable  to  be --
  27. -- covered  by the  GNU  General  Public  License.  This exception does not --
  28. -- however invalidate  any other reasons why  the executable file  might be --
  29. -- covered by the  GNU Public License.                                      --
  30. --                                                                          --
  31. -- GNARL was developed by the GNARL team at Florida State University. It is --
  32. -- now maintained by Ada Core Technologies Inc. in cooperation with Florida --
  33. -- State University (http://www.gnat.com).                                  --
  34. --                                                                          --
  35. ------------------------------------------------------------------------------
  36.  
  37. with System.Tasking.Protected_Objects.Entries;
  38.  
  39. package System.Tasking.Queuing is
  40.  
  41.    package POE renames System.Tasking.Protected_Objects.Entries;
  42.  
  43.    procedure Broadcast_Program_Error
  44.      (Self_ID      : Task_ID;
  45.       Object       : POE.Protection_Entries_Access;
  46.       Pending_Call : Entry_Call_Link);
  47.    --  Raise Program_Error in all tasks calling the protected entries
  48.    --  of Object.  The exception will not be raised immediately for
  49.    --  the calling task; it will be deferred until it calls
  50.    --  Raise_Pending_Exception.
  51.  
  52.    procedure Enqueue (E : in out Entry_Queue; Call : Entry_Call_Link);
  53.    --  Enqueue Call at the end of entry_queue E
  54.  
  55.    procedure Dequeue (E : in out Entry_Queue; Call : Entry_Call_Link);
  56.    --  Dequeue Call from entry_queue E
  57.  
  58.    function Head (E : in Entry_Queue) return Entry_Call_Link;
  59.    --  Return the head of entry_queue E
  60.    pragma Inline (Head);
  61.  
  62.    procedure Dequeue_Head
  63.      (E    : in out Entry_Queue;
  64.       Call : out Entry_Call_Link);
  65.    --  Remove and return the head of entry_queue E
  66.  
  67.    function Onqueue (Call : Entry_Call_Link) return Boolean;
  68.    --  Return True if Call is on any entry_queue at all
  69.    pragma Inline (Onqueue);
  70.  
  71.    function Count_Waiting (E : in Entry_Queue) return Natural;
  72.    --  Return number of calls on the waiting queue of E
  73.  
  74.    procedure Select_Task_Entry_Call
  75.      (Acceptor         : Task_ID;
  76.       Open_Accepts     : Accept_List_Access;
  77.       Call             : out Entry_Call_Link;
  78.       Selection        : out Select_Index;
  79.       Open_Alternative : out Boolean);
  80.    --  Select an entry for rendezvous.  On exit:
  81.    --    Call will contain a pointer to the entry call record selected;
  82.    --    Selection will contain the index of the alternative selected
  83.    --    Open_Alternative will be True if there were any open alternatives
  84.  
  85.    procedure Select_Protected_Entry_Call
  86.      (Self_ID   : Task_ID;
  87.       Object    : POE.Protection_Entries_Access;
  88.       Call      : out Entry_Call_Link);
  89.    --  Select an entry of a protected object
  90.  
  91.    procedure Enqueue_Call (Entry_Call : Entry_Call_Link);
  92.    procedure Dequeue_Call (Entry_Call : Entry_Call_Link);
  93.    --  Enqueue (dequeue) the call to (from) whatever server they are
  94.    --  calling, whether a task or a protected object.
  95.  
  96.    procedure Requeue_Call_With_New_Prio
  97.      (Entry_Call : Entry_Call_Link; Prio : System.Any_Priority);
  98.    --  Change Priority of the call and re insert to the queue when priority
  99.    --  queueing is in effect. When FIFO is inforced, this routine
  100.    --  should not have any effect.
  101.  
  102. end System.Tasking.Queuing;
  103.