home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / ada / gnat-3.05- / gnat-3 / gnat-3.05-i486-linux-elf-bin / examples / chop.adb next >
Encoding:
Text File  |  1996-06-11  |  446 b   |  27 lines

  1. ------
  2. --::::::::::
  3. --chop.adb
  4. --::::::::::
  5. package body Chop is
  6.  
  7.   -- Dining Philosophers - Ada 95 edition
  8.   -- Chopstick is an Ada 95 protected type
  9.   -- Michael B. Feldman, The George Washington University,
  10.   -- July, 1995.
  11.  
  12.   protected body Stick is
  13.  
  14.     entry PIck_Up when not In_Use is
  15.     begin
  16.       In_Use := True;
  17.     end PIck_Up;
  18.  
  19.     procedure Put_Down is
  20.     begin
  21.       In_Use := False;
  22.     end Put_Down;
  23.  
  24.   end Stick;
  25.  
  26. end Chop;
  27.