# tbb::interface6::task_scheduler_observer Class Reference

Inheritance diagram for tbb::interface6::task_scheduler_observer:

List of all members.

## Public Member Functions
| task_scheduler_observer (bool local=false)
| Construct local or global observer in inactive state (observation disabled).
| task_scheduler_observer (task_arena &a)
| Construct local observer for a given arena in inactive state (observation disabled).
virtual bool | on_scheduler_leaving ()
| The callback can be invoked in a worker thread before it leaves an arena.
virtual | ~task_scheduler_observer ()
| Destructor additionally protects concurrent on_scheduler_leaving notification.
## Friends
class | internal::task_scheduler_observer_v3
class | internal::observer_proxy
class | internal::observer_list

## Constructor & Destructor Documentation

tbb::interface6::task_scheduler_observer::task_scheduler_observer | ( | bool | local = `false` | ) | `[inline]`

Construct local or global observer in inactive state (observation disabled).

For a local observer entry/exit notifications are invoked whenever a worker thread joins/leaves the arena of the observer's owner thread. If a thread is already in the arena when the observer is activated, the entry notification is called before it executes the first stolen task. TODO: Obsolete. Global observer semantics is obsolete as it violates master thread isolation guarantees and is not composable. Thus the current default behavior of the constructor is obsolete too and will be changed in one of the future versions of the library.

References tbb::relaxed.

tbb::interface6::task_scheduler_observer::task_scheduler_observer | ( | task_arena & | a | ) | `[inline]`

Construct local observer for a given arena in inactive state (observation disabled).

entry/exit notifications are invoked whenever a thread joins/leaves arena. If a thread is already in the arena when the observer is activated, the entry notification is called before it executes the first stolen task.

## Member Function Documentation

virtual bool tbb::interface6::task_scheduler_observer::on_scheduler_leaving | ( |  | ) | `[inline, virtual]`

The callback can be invoked in a worker thread before it leaves an arena.

If it returns false, the thread remains in the arena. Will not be called for masters or if the worker leaves arena due to rebalancing or priority changes, etc. NOTE: The preview library must be linked for this method to take effect

The documentation for this class was generated from the following file:

- task_scheduler_observer.h

Copyright © 2005-2013 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.