Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProgramCall isRunning flag is only set when a timeout is specified for the programCall #194

Open
SvenT23 opened this issue Aug 13, 2024 · 0 comments

Comments

@SvenT23
Copy link

SvenT23 commented Aug 13, 2024

Instead of the running flag (which can be checked using the public isRunning method) being set at the start and the end of the run logic, it is instead set within the startCancelThread and endCancelThread:

private void startCancelThread() {
        // Start a cancel thread if there is a program running and a timeout value has been specified.
        if (timeOut_ != 0) {

               // Set a flag that a program is running.

                running_ = true;

                // Create a thread to do the cancel if needed.  Start the thread.
                cancelThread_ = new ProgramCallCancelThread(this);

                cancelThread_.setDaemon(true);

                cancelThread_.start();
        }
    }

This seems counterintuitive, as it results in the running flag always being false if no timeout was specified. The javadoc for the isRunning method also does not specify that it only works when a timeout was given.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant