[tf.data] Maintain a reference on the FunctionBufferingResource while a get-next...
authorDerek Murray <mrry@google.com>
Thu, 29 Mar 2018 03:44:51 +0000 (20:44 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Thu, 29 Mar 2018 03:47:31 +0000 (20:47 -0700)
commit789e442513e85ab1caeb1e03997b0aafa3cd76d7
tree95044b6d487aac261fc958054fd905f61abbb3ea
parenta5a90e6b55c19bd14d5effa5cb1695ddbe31026f
[tf.data] Maintain a reference on the FunctionBufferingResource while a get-next operation is active.

Previously, the reference count on a FunctionBufferingResource could drop to 0 and it could be deleted (e.g. by a DestroyResourceOp) while a get-next operation is active on it. This would lead to use-after-free errors.

PiperOrigin-RevId: 190878208
tensorflow/contrib/data/kernels/prefetching_kernels.cc