Replace deprecated thread annotations macros.
PiperOrigin-RevId: 353683452 Change-Id: I0892e7e78a16f1f05ddb816bcd13bf7b7aa30de1
This commit is contained in:
parent
5cd9da0f25
commit
4e224e064d
@ -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(), {}};
|
||||
|
||||
|
@ -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(),
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
@ -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 =
|
||||
|
Loading…
Reference in New Issue
Block a user