Skip to content

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

@SvenT23

Description

@SvenT23

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions