diff options
author | 2018-03-30 09:56:29 -0700 | |
---|---|---|
committer | 2018-03-30 09:59:04 -0700 | |
commit | 3d9c27742693f9859e2fb75de57fe108520de712 (patch) | |
tree | 5bea50f56bee4166629de2f5fea43e4fe8400285 /tensorflow/core/common_runtime/process_function_library_runtime.h | |
parent | e995271f8550bf6b62fb9089ea702f2114783904 (diff) |
Fix several data races by acquiring locks.
(The racy accesses were detected by the thread safety annotations.)
PiperOrigin-RevId: 191077376
Diffstat (limited to 'tensorflow/core/common_runtime/process_function_library_runtime.h')
-rw-r--r-- | tensorflow/core/common_runtime/process_function_library_runtime.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tensorflow/core/common_runtime/process_function_library_runtime.h b/tensorflow/core/common_runtime/process_function_library_runtime.h index d69e8bc2a0..c7b8259f78 100644 --- a/tensorflow/core/common_runtime/process_function_library_runtime.h +++ b/tensorflow/core/common_runtime/process_function_library_runtime.h @@ -155,7 +155,10 @@ class ProcessFunctionLibraryRuntime { string target_device() { return target_device_; } - FunctionLibraryRuntime::LocalHandle local_handle() { return local_handle_; } + FunctionLibraryRuntime::LocalHandle local_handle() { + mutex_lock l(mu_); + return local_handle_; + } // Initializes the FunctionData object by potentially making an Initialize // call to the DistributedFunctionLibraryRuntime. |