title: Ada TASKING_ERROR
body: <p>Assume the following situation:
  There is a box, which is used to store coins
  People take money from the box
  People put money into the box
  i have take task entry as  Add, Subtract, Read and Write. below is my code .now i am confused how to call entry add ,subtract and read to achieve above requirement   please help</p>
  <pre><code>with Ada.Text_IO,ada.integer_text_io;
  use ada.text_io,ada.integer_text_io;
  
  procedure protected_imp is
     task type box(initial_value:integer;min_value:integer;max_value:integer) is
        entry add(number:integer); 
        entry subtract(number:integer);
        entry read;
     end box;
     task body box is 
        x:integer:=initial_value; --shared variable
     begin
        loop                  --why raised TASKING_ERROR when loop is removed?
           select
              when x&lt;max_value=&gt;
                 accept add(number:integer)do
                    x:=x+number;
                 end add;
           or  
              when x&gt;min_value=&gt;
                 accept subtract(number:integer) do
                    x:=x-number;
                 end subtract;
           or
              accept read do
                 put(&quot;coins&quot;);
                 put_line(integer'image(x));
              end read;
           or
              delay(5.0);
              put(&quot;no request received for 5 seconds&quot;);
           end select;
        end loop;
     end box;
     go:box(1,0,10);
  begin ----- how to call? and why  i am getting &quot;no request received for 5 seconds &quot; even i have activate go .add(1) ?
     for i in 1..5 loop
        go.add(1);
     end loop;
     go.read;
  end protected_imp;
  </code></pre>