From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,52e0ea3ba6aa2c10,start X-Google-Attributes: gid103376,public From: John McCabe Subject: Failed Runtime Assertion: GNULLI failure---pthread_mutex_destroy Date: 1998/06/09 Message-ID: <6ljndp$94e@gcsin3.geccs.gecm.com>#1/1 X-Deja-AN: 361056132 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: GMS&T Newsgroups: comp.lang.ada Date: 1998-06-09T00:00:00+00:00 List-Id: The code below is just a little experiment I am doing with getting task object to talk to each other (rather incestuously as it happens but that's beside the point). I'm using GNAT 3.05 for DOS (I know it's out of date etc but...) on a Dell Optiplex Pentium 75. The first time I press 'n' there is no problem, but the 2nd time it raises the error in the header of this message. Can anyone explain what would be causing this? Does anyone know if this also happens with later versions of GNAT? (Use Gnatmake t_proced.adb to compile - is there something I need to add?) TIA Filename: T_ACCESS.ADS --------------- with Ada.Text_IO; package T_Access is type Parent_Task; type Parent_Task_Pointer is access Parent_Task; type Child_Task; type Child_Task_Pointer is access Child_Task; task type Child_Task is entry Set_Parent (Parent_Pointer : Parent_Task_Pointer); entry Shut_Down; end Child_Task; task type Parent_Task is entry Set_Child (Child_Pointer : Child_Task_Pointer); entry Print_Out (Print_String : String); end Parent_Task; end T_Access; --------------- Filename: T_ACCESS.ADB --------------- with Ada.Text_IO; package body T_Access is task body Child_Task is Shut_Down_Requested : Boolean := False; Timeouts : Integer := 0; Parent : Parent_Task_Pointer; begin accept Set_Parent (Parent_Pointer : T_Access.Parent_Task_Pointer) do Parent := Parent_Pointer; end Set_Parent; loop select accept Shut_Down do Shut_Down_Requested := True; end Shut_Down; else select Parent.Print_Out ("Hello" & Integer'IMAGE (Timeouts)); Timeouts := 0; or delay 1.0; Timeouts := Timeouts + 1; end select; end select; exit when Shut_Down_Requested; end loop; end Child_Task; task body Parent_Task is Shut_Down_Requested : Boolean := False; Quit : String (1..40); Quit_Len : Integer; Child : Child_Task_Pointer; begin accept Set_Child (Child_Pointer : T_Access.Child_Task_Pointer) do Child := Child_Pointer; end Set_Child; loop Ada.Text_IO.Put ("Do you want to quit [Y/N]? : "); Ada.Text_IO.Get_Line (Quit, Quit_Len); if ((Quit(1) = 'Y') or (Quit(1) = 'y')) then Shut_Down_Requested := True; Child.Shut_Down; else accept Print_Out (Print_String : String) do Ada.Text_IO.Put_Line (Print_String); end Print_Out; end if; exit when Shut_Down_Requested; end loop; end Parent_Task; end T_Access; --------------- Filename: T_PROCED.ADB --------------- with Ada.Text_IO; with T_Access; procedure T_Proced is The_Child_Pointer : T_Access.Child_Task_Pointer; The_Parent_Pointer : T_Access.Parent_Task_Pointer; begin Ada.Text_IO.Put_Line("Creating the Child Task..."); The_Child_Pointer := new T_Access.Child_Task; Ada.Text_IO.Put_Line("Creating the Parent Task..."); The_Parent_Pointer := new T_Access.Parent_Task; Ada.Text_IO.Put_Line("Pointing the Child to the Parent..."); The_Child_Pointer.Set_Parent (The_Parent_Pointer); Ada.Text_IO.Put_Line("Pointing the Parent to the Child..."); The_Parent_Pointer.Set_Child (The_Child_Pointer); -- Now just need to wait for them to finish! end T_Proced; --------------- -- Best Regards John McCabe ===================================================================== Not necessarily my company or service providers opinions. =====================================================================