Remove the AsyncInvoker alias.
This emphasizes the "hint" to potential external users that the class has been deprecated. Bug: webrtc:12339 Change-Id: Iab83481af69a505059297cce959f02b5ab649f2f Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237805 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Tommi <tommi@webrtc.org> Cr-Commit-Position: refs/heads/main@{#35368}
This commit is contained in:
@ -1172,8 +1172,8 @@ void UsrsctpTransport::OnPacketRead(rtc::PacketTransportInternal* transport,
|
||||
// packet will have called connect, and a connection will be established.
|
||||
if (sock_) {
|
||||
// Pass received packet to SCTP stack. Once processed by usrsctp, the data
|
||||
// will be will be given to the global OnSctpInboundData, and then,
|
||||
// marshalled by the AsyncInvoker.
|
||||
// will be will be given to the global OnSctpInboundPacket callback and
|
||||
// posted to the transport thread.
|
||||
VerboseLogPacket(data, len, SCTP_DUMP_INBOUND);
|
||||
usrsctp_conninput(reinterpret_cast<void*>(id_), data, len, 0);
|
||||
} else {
|
||||
|
||||
@ -26,6 +26,8 @@
|
||||
|
||||
namespace rtc {
|
||||
|
||||
// DEPRECATED - do not use.
|
||||
//
|
||||
// Invokes function objects (aka functors) asynchronously on a Thread, and
|
||||
// owns the lifetime of calls (ie, when this object is destroyed, calls in
|
||||
// flight are cancelled). AsyncInvoker can optionally execute a user-specified
|
||||
@ -153,10 +155,9 @@ class DEPRECATED_AsyncInvoker : public MessageHandlerAutoCleanup {
|
||||
// future.
|
||||
std::atomic<int> pending_invocations_;
|
||||
|
||||
// Reference counted so that if the AsyncInvoker destructor finishes before
|
||||
// an AsyncClosure's destructor that's about to call
|
||||
// "invocation_complete_->Set()", it's not dereferenced after being
|
||||
// destroyed.
|
||||
// Reference counted so that if the destructor finishes before an
|
||||
// AsyncClosure's destructor that's about to call
|
||||
// "invocation_complete_->Set()", it's not dereferenced after being destroyed.
|
||||
rtc::Ref<Event>::Ptr invocation_complete_;
|
||||
|
||||
// This flag is used to ensure that if an application AsyncInvokes tasks that
|
||||
@ -169,9 +170,6 @@ class DEPRECATED_AsyncInvoker : public MessageHandlerAutoCleanup {
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(DEPRECATED_AsyncInvoker);
|
||||
};
|
||||
|
||||
using AsyncInvoker ABSL_DEPRECATED("bugs.webrtc.org/12339") =
|
||||
DEPRECATED_AsyncInvoker;
|
||||
|
||||
} // namespace rtc
|
||||
|
||||
#endif // RTC_BASE_ASYNC_INVOKER_H_
|
||||
|
||||
@ -23,7 +23,7 @@ namespace rtc {
|
||||
|
||||
class DEPRECATED_AsyncInvoker;
|
||||
|
||||
// Helper class for AsyncInvoker. Runs a task and triggers a callback
|
||||
// Helper class for DEPRECATED_AsyncInvoker. Runs a task and triggers a callback
|
||||
// on the calling thread if necessary.
|
||||
class AsyncClosure {
|
||||
public:
|
||||
|
||||
@ -742,7 +742,7 @@ TEST(ThreadManager, ClearReentrant) {
|
||||
new ScopedRefMessageData<RefCountedHandler>(inner_handler));
|
||||
}
|
||||
|
||||
class AsyncInvokeTest : public ::testing::Test {
|
||||
class DEPRECATED_AsyncInvokeTest : public ::testing::Test {
|
||||
public:
|
||||
void IntCallback(int value) {
|
||||
EXPECT_EQ(expected_thread_, Thread::Current());
|
||||
@ -754,13 +754,13 @@ class AsyncInvokeTest : public ::testing::Test {
|
||||
|
||||
protected:
|
||||
enum { kWaitTimeout = 1000 };
|
||||
AsyncInvokeTest() : int_value_(0), expected_thread_(nullptr) {}
|
||||
DEPRECATED_AsyncInvokeTest() : int_value_(0), expected_thread_(nullptr) {}
|
||||
|
||||
int int_value_;
|
||||
Thread* expected_thread_;
|
||||
};
|
||||
|
||||
TEST_F(AsyncInvokeTest, FireAndForget) {
|
||||
TEST_F(DEPRECATED_AsyncInvokeTest, FireAndForget) {
|
||||
DEPRECATED_AsyncInvoker invoker;
|
||||
// Create and start the thread.
|
||||
auto thread = Thread::CreateWithSocketServer();
|
||||
@ -772,7 +772,7 @@ TEST_F(AsyncInvokeTest, FireAndForget) {
|
||||
thread->Stop();
|
||||
}
|
||||
|
||||
TEST_F(AsyncInvokeTest, NonCopyableFunctor) {
|
||||
TEST_F(DEPRECATED_AsyncInvokeTest, NonCopyableFunctor) {
|
||||
DEPRECATED_AsyncInvoker invoker;
|
||||
// Create and start the thread.
|
||||
auto thread = Thread::CreateWithSocketServer();
|
||||
@ -784,7 +784,7 @@ TEST_F(AsyncInvokeTest, NonCopyableFunctor) {
|
||||
thread->Stop();
|
||||
}
|
||||
|
||||
TEST_F(AsyncInvokeTest, KillInvokerDuringExecute) {
|
||||
TEST_F(DEPRECATED_AsyncInvokeTest, KillInvokerDuringExecute) {
|
||||
// Use these events to get in a state where the functor is in the middle of
|
||||
// executing, and then to wait for it to finish, ensuring the "EXPECT_FALSE"
|
||||
// is run.
|
||||
@ -821,10 +821,10 @@ TEST_F(AsyncInvokeTest, KillInvokerDuringExecute) {
|
||||
}
|
||||
|
||||
// Variant of the above test where the async-invoked task calls AsyncInvoke
|
||||
// *again*, for the thread on which the AsyncInvoker is currently being
|
||||
// destroyed. This shouldn't deadlock or crash; this second invocation should
|
||||
// just be ignored.
|
||||
TEST_F(AsyncInvokeTest, KillInvokerDuringExecuteWithReentrantInvoke) {
|
||||
// *again*, for the thread on which the invoker is currently being destroyed.
|
||||
// This shouldn't deadlock or crash. The second invocation should be ignored.
|
||||
TEST_F(DEPRECATED_AsyncInvokeTest,
|
||||
KillInvokerDuringExecuteWithReentrantInvoke) {
|
||||
Event functor_started;
|
||||
// Flag used to verify that the recursively invoked task never actually runs.
|
||||
bool reentrant_functor_run = false;
|
||||
@ -851,7 +851,7 @@ TEST_F(AsyncInvokeTest, KillInvokerDuringExecuteWithReentrantInvoke) {
|
||||
EXPECT_FALSE(reentrant_functor_run);
|
||||
}
|
||||
|
||||
TEST_F(AsyncInvokeTest, Flush) {
|
||||
TEST_F(DEPRECATED_AsyncInvokeTest, Flush) {
|
||||
DEPRECATED_AsyncInvoker invoker;
|
||||
AtomicBool flag1;
|
||||
AtomicBool flag2;
|
||||
@ -867,7 +867,7 @@ TEST_F(AsyncInvokeTest, Flush) {
|
||||
EXPECT_TRUE(flag2.get());
|
||||
}
|
||||
|
||||
TEST_F(AsyncInvokeTest, FlushWithIds) {
|
||||
TEST_F(DEPRECATED_AsyncInvokeTest, FlushWithIds) {
|
||||
DEPRECATED_AsyncInvoker invoker;
|
||||
AtomicBool flag1;
|
||||
AtomicBool flag2;
|
||||
|
||||
Reference in New Issue
Block a user