7.7.5 sg::SchedulerThread class

This section describes the SchedulerThread class.

sg::SchedulerThread - about

This class is a thread interface on the thread instance/scheduler side. The SchedulerInterfaceForComponents::createThread() function creates the SchedulerThread objects. Modeling components use this interface to talk to the scheduler

sg::SchedulerThread::destructor

This method destroys SchedulerThread objects.

~SchedulerThread();

This destructor kills threads if the underlying scheduler implementation supports it. Killing threads without their cooperation is unclean because it might leak resources. To end a thread cleanly, signal the thread to return from its threadProc() function, for example by using an exception that is caught in threadProc(). Destroying this object before calling start() must not start the thread. Destroying this object after calling start() might kill the thread immediately or leave it running until it returns from its threadProc().

SchedulerThread inherits this method from sg::SchedulerObject.

sg::SchedulerThread::getName

This method returns the name of the instance that owns the object.

const char *getName() const;

This is the name that createThread() received.

SchedulerThread inherits this method from sg::SchedulerObject.

sg::SchedulerThread::setFrequency

This method sets the frequency source to be the parent clock for the thread. Arm deprecates this function.

sg::SchedulerThread::start

This method starts the thread.

void start();

This method calls the threadProc() function immediately, which must call wait(0, ...) after initialization in order for start() to return. start() only runs the threadProc() of the associated thread and no other threads. Calling start() on a running thread has no effect. Calling start() on a terminated thread (threadProc() returned) has no effect.

Note:

The modeling component counterpart of the sg::SchedulerThread class is sg::SchedulerRunnable. Runnable objects must call sg::QuantumKeeper::sync() regularly to pass execution control on to other threads.
Non-ConfidentialPDF file icon PDF version100965_1180_00_en
Copyright © 2014–2019 Arm Limited or its affiliates. All rights reserved.