17 #ifndef __TBB_task_scheduler_observer_H 18 #define __TBB_task_scheduler_observer_H 21 #if __TBB_ARENA_OBSERVER 25 #if __TBB_SCHEDULER_OBSERVER 28 namespace interface6 {
29 class task_scheduler_observer;
87 #if __TBB_ARENA_OBSERVER 88 namespace interface6 {
90 friend class internal::task_scheduler_observer_v3;
91 friend class internal::observer_proxy;
92 friend class internal::observer_list;
97 static const intptr_t v6_trait = (intptr_t)((~(uintptr_t)0 >> 1) + 1);
101 enum { global_tag = 0, implicit_tag = 1 };
115 #if __TBB_ARENA_OBSERVER 116 my_context_tag = local? implicit_tag : global_tag;
119 my_context_tag = global_tag;
123 #if __TBB_ARENA_OBSERVER 129 my_context_tag = (intptr_t)&a;
void observe(bool state=true)
Enable or disable observation.
task_scheduler_observer(task_arena &a)
Construct local observer for a given arena in inactive state (observation disabled).
#define __TBB_EXPORTED_METHOD
friend class observer_proxy
task_scheduler_observer(bool local=false)
Construct local or global observer in inactive state (observation disabled).
intptr_t my_context_tag
contains task_arena pointer or tag indicating local or global semantics of the observer ...
void store(value_type value)
virtual void on_scheduler_entry(bool)
Entry notification.
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
void __TBB_EXPORTED_METHOD observe(bool state=true)
Enable or disable observation.
task_scheduler_observer_v3()
Construct observer with observation disabled.
#define __TBB_ASSERT_EX(predicate, comment)
"Extended" version is useful to suppress warnings if a variable is only used with an assert ...
observer_proxy * my_proxy
Pointer to the proxy holding this observer.
bool is_observing() const
Returns true if observation is enabled, false otherwise.
virtual ~task_scheduler_observer_v3()
Destructor automatically switches observation off if it is enabled.
virtual ~task_scheduler_observer()
friend class observer_list
virtual void on_scheduler_exit(bool)
Exit notification.
atomic< intptr_t > my_busy_count
Counter preventing the observer from being destroyed while in use by the scheduler.