aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/public/env.h
diff options
context:
space:
mode:
authorGravatar Derek Murray <mrry@google.com>2015-12-22 15:07:09 -0800
committerGravatar Vijay Vasudevan <vrv@google.com>2015-12-22 15:07:09 -0800
commit38f39eb3798f0162497ef032e5ccb21783ea20fe (patch)
tree78397bf60a42bcac130f487fb2543976e1cde651 /tensorflow/core/public/env.h
parentedc01d3000a197ac8d5ccd14c133ae2537cb08aa (diff)
Add non-functional stubs for a closure executor to tensorflow::Env.
Change: 110797223
Diffstat (limited to 'tensorflow/core/public/env.h')
-rw-r--r--tensorflow/core/public/env.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/tensorflow/core/public/env.h b/tensorflow/core/public/env.h
index fe68167c04..ac34a02c89 100644
--- a/tensorflow/core/public/env.h
+++ b/tensorflow/core/public/env.h
@@ -134,6 +134,17 @@ class Env {
const string& name,
std::function<void()> fn) TF_MUST_USE_RESULT = 0;
+ // \brief Schedules the given closure on a thread-pool.
+ //
+ // NOTE(mrry): This closure must not block.
+ virtual void SchedClosure(std::function<void()> closure) = 0;
+
+ // \brief Schedules the given closure on a thread-pool after the given number
+ // of microseconds.
+ //
+ // NOTE(mrry): This closure must not block.
+ virtual void SchedClosureAfter(int micros, std::function<void()> closure) = 0;
+
private:
/// No copying allowed
Env(const Env&);
@@ -234,6 +245,12 @@ class EnvWrapper : public Env {
std::function<void()> fn) override {
return target_->StartThread(thread_options, name, fn);
}
+ void SchedClosure(std::function<void()> closure) override {
+ target_->SchedClosure(closure);
+ }
+ void SchedClosureAfter(int micros, std::function<void()> closure) override {
+ target_->SchedClosureAfter(micros, closure);
+ }
private:
Env* target_;