diff options
author | Skye Wanderman-Milne <skyewm@google.com> | 2018-03-12 11:02:29 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-03-12 11:06:44 -0700 |
commit | 1d6a57edc0be0dcc0c92eb2610b88420a7b7be51 (patch) | |
tree | beec27e175dc508ad0340d57b89676a805e5c79d /tensorflow/c/python_api.cc | |
parent | 89177f289e9467e04b205a1a3e705ad67d9854d2 (diff) |
Fix race in C API.
RecordMutation could race with ExtendSessionGraphHelper, which would
release the graph lock and only keep the session lock when extending
the session.
Also makes sure thread annotations are on declarations, not definitions
(otherwise they have no effect).
PiperOrigin-RevId: 188747158
Diffstat (limited to 'tensorflow/c/python_api.cc')
-rw-r--r-- | tensorflow/c/python_api.cc | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tensorflow/c/python_api.cc b/tensorflow/c/python_api.cc index 26683f50ec..cd604538f1 100644 --- a/tensorflow/c/python_api.cc +++ b/tensorflow/c/python_api.cc @@ -105,9 +105,8 @@ void SetRequireShapeInferenceFns(TF_Graph* graph, bool require) { } void ExtendSession(TF_Session* session, TF_Status* status) { - mutex_lock l(session->mu); - session->extend_before_run = false; ExtendSessionGraphHelper(session, status); + session->extend_before_run = false; } } // namespace tensorflow |