code: synchronized void stop_polling() throws DevFailed {
          Util.out4.println("In stop_polling method");
  
          // Send command to the polling thread and wait for its execution
          final Util tg = Util.instance();
          final TangoMonitor mon = tg.get_poll_monitor();
          final PollThCmd shared_cmd = tg.get_poll_shared_cmd();
          if (shared_cmd.cmd_pending == true) {
              mon.signal();
          }
          shared_cmd.cmd_pending = true;
          shared_cmd.cmd_code = Tango_POLL_STOP;
  
          mon.signal();
  
          boolean interupted;
          while (shared_cmd.cmd_pending == true) {
              interupted = mon.wait_it(Tango_DEFAULT_TIMEOUT);
  
              if (shared_cmd.cmd_pending == true && interupted == false) {
                  Util.out4.println("TIME OUT");
                  Except.throw_exception("API_CommandTimedOut", "Polling thread blocked !!!",
                          "DServer.stop_polling");
              }
          }
  
          // Update polling status
          tg.poll_status(false);
          set_status("The device is ON\nThe polling is OFF");
      }
docs: ===================================================================