-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2005, AdaCore --
+-- Copyright (C) 2001-2006, 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- --
when Socket_Error =>
null;
end;
+
+ -- Reset R_Sig_Socket and W_Sig_Socket to No_Socket to ensure that any
+ -- (errneous) subsequent attempt to use this selector properly fails.
+
+ Selector.R_Sig_Socket := No_Socket;
+ Selector.W_Sig_Socket := No_Socket;
end Close_Selector;
------------------
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2005, AdaCore --
+-- Copyright (C) 2001-2006, 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- --
-- Create a new selector
procedure Close_Selector (Selector : in out Selector_Type);
- -- Close Selector and all internal descriptors associated
+ -- Close Selector and all internal descriptors associated; deallocate any
+ -- associated resources. This subprogram may be called only when there is
+ -- no other task still using Selector (i.e. still executing Check_Selector
+ -- or Abort_Selector on this Selector).
type Selector_Status is (Completed, Expired, Aborted);
No_Socket : constant Socket_Type := -1;
type Selector_Type is limited record
- R_Sig_Socket : Socket_Type;
- W_Sig_Socket : Socket_Type;
+ R_Sig_Socket : Socket_Type := No_Socket;
+ W_Sig_Socket : Socket_Type := No_Socket;
end record;
pragma Volatile (Selector_Type);