Replace deprecated thread annotations macros.

PiperOrigin-RevId: 353683452
Change-Id: I0892e7e78a16f1f05ddb816bcd13bf7b7aa30de1
This commit is contained in:
A. Unique TensorFlower 2021-01-25 10:57:53 -08:00 committed by TensorFlower Gardener
parent 5cd9da0f25
commit 4e224e064d
7 changed files with 10 additions and 7 deletions

View File

@ -557,7 +557,7 @@ class EagerContext : public ImmediateExecutionContext, public core::RefCounted {
// CompositeDevice.
// TODO(b/145922293): Consider taking device names as keys.
absl::flat_hash_map<uint64, std::unique_ptr<CompositeDevice>>
composite_devices_ GUARDED_BY(composite_devices_mu_);
composite_devices_ ABSL_GUARDED_BY(composite_devices_mu_);
FunctionLibraryDefinition func_lib_def_{OpRegistry::Global(), {}};

View File

@ -97,6 +97,7 @@ cc_library(
":worker_cc_grpc_proto",
"//tensorflow/core:framework",
"//tensorflow/core/platform:errors",
"//tensorflow/core/platform:thread_annotations",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/types:optional",
tf_grpc_cc_dependency(),

View File

@ -308,10 +308,11 @@ class GrpcDataTransferClient : public DataTransferClient {
std::unique_ptr<WorkerService::Stub> stub_;
// Set of all currently active clients contexts. Used to support
// cancellation.
absl::flat_hash_set<::grpc::ClientContext*> active_contexts_ GUARDED_BY(mu_);
absl::flat_hash_set<::grpc::ClientContext*> active_contexts_
ABSL_GUARDED_BY(mu_);
// Indicates that the client has been cancelled, so no further requests should
// be accepted.
bool cancelled_ GUARDED_BY(mu_) = false;
bool cancelled_ ABSL_GUARDED_BY(mu_) = false;
};
class GrpcTransferClientRegistrar {

View File

@ -23,6 +23,7 @@ limitations under the License.
#include "tensorflow/core/data/service/worker.grpc.pb.h"
#include "tensorflow/core/framework/dataset.h"
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/platform/thread_annotations.h"
namespace tensorflow {
namespace data {

View File

@ -150,7 +150,7 @@ class IfOp : public AsyncOpKernel {
mutex mu_;
std::unordered_map<FunctionLibraryRuntime*, std::pair<FHandle, FHandle>>
handles_ GUARDED_BY(mu_);
handles_ ABSL_GUARDED_BY(mu_);
class State {
public:
@ -395,7 +395,7 @@ class WhileOp : public AsyncOpKernel {
mutex mu_;
std::unordered_map<FunctionLibraryRuntime*, std::pair<FHandle, FHandle>>
handles_ GUARDED_BY(mu_);
handles_ ABSL_GUARDED_BY(mu_);
static Status CondResultToBool(OpKernelContext* ctx,
const FunctionLibraryRuntime::Options& opts,

View File

@ -126,7 +126,7 @@ class ProfilerServiceImpl : public grpc::ProfilerService::Service {
mutex mutex_;
absl::flat_hash_map<std::string, bool> stop_signals_per_session_
GUARDED_BY(mutex_);
ABSL_GUARDED_BY(mutex_);
};
} // namespace

View File

@ -120,7 +120,7 @@ class AcceleratorRegistry {
absl::Mutex mutex_;
std::unordered_map<std::string, CreatorFunction> factories_
GUARDED_BY(mutex_);
ABSL_GUARDED_BY(mutex_);
};
using DelegatePluginRegistry =