Fix race in C API.
authorSkye Wanderman-Milne <skyewm@google.com>
Mon, 12 Mar 2018 18:02:29 +0000 (11:02 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Mon, 12 Mar 2018 18:06:44 +0000 (11:06 -0700)
commit1d6a57edc0be0dcc0c92eb2610b88420a7b7be51
treebeec27e175dc508ad0340d57b89676a805e5c79d
parent89177f289e9467e04b205a1a3e705ad67d9854d2
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
tensorflow/c/c_api.cc
tensorflow/c/c_api_internal.h
tensorflow/c/python_api.cc