webrtc/net/dcsctp/socket
Victor Boivie 6791c9d17e dcsctp: Relax thread sequence checker
The DcSctpSocket is thread compatible. As long as you serialize accesses
to it - either by calling it from the same thread, or using some kind of
concurrency primitive (e.g. mutex) to avoid calling the API methods from
different threads concurrently, it's fine.

Using the sequence checker, we can verify that the socket is called from
the thread it was created on, or from the same task queue. This provided
a more strict verification, as it didn't allow e.g. creating a socket on
one thread, and then handing it to a different thread where it was used.
Nor did it allow having multiple threads use it, protecting any calls to
it using an external mutex.

One can avoid these checks using webrtc::CurrentTaskQueueSetter to allow
the sequence checker to believe it's running where it's not running, but
this is a hack.

This CL removes the sequence checker in the socket, to simplify using it
in environments that don't use task queues for synchronization. Since it
is still kept in dcsctp::TaskQueueTimeoutFactory, it's still used in all
environments where the task queue is used (e.g. Chrome).

This makes it easier to use dcSCTP without WebRTC.

Bug: None
Change-Id: I2674d7cd902bad45ed3d0816c908ecf3ee971727
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/333801
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Victor Boivie <boivie@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41482}
2024-01-09 11:50:44 +00:00
..
BUILD.gn dcsctp: Relax thread sequence checker 2024-01-09 11:50:44 +00:00
callback_deferrer.cc Change CallbackDeferrer to pre-reserve the deferred vector. 2023-12-14 21:08:58 +00:00
callback_deferrer.h Change CallbackDeferrer to use a variant and callback pointer instead of std::function 2023-12-12 13:15:12 +00:00
capabilities.h Reapply "dcsctp: Negotiate zero checksum" 2023-09-23 21:33:52 +00:00
context.h dcsctp: Convert timers to rtc::TimeDelta 2023-11-07 21:42:15 +00:00
dcsctp_socket.cc dcsctp: Relax thread sequence checker 2024-01-09 11:50:44 +00:00
dcsctp_socket.h dcsctp: Relax thread sequence checker 2024-01-09 11:50:44 +00:00
dcsctp_socket_network_test.cc dcsctp: Convert use of TimeMs to webrtc::Timestamp 2023-11-12 21:12:29 +00:00
dcsctp_socket_test.cc Add SendMany method to dcsctp socket 2023-12-15 21:35:14 +00:00
DEPS dcsctp: Add network/throughput tests 2021-09-30 07:59:58 +00:00
heartbeat_handler.cc dcsctp: Convert use of TimeMs to webrtc::Timestamp 2023-11-12 21:12:29 +00:00
heartbeat_handler.h dcsctp: Convert timers to rtc::TimeDelta 2023-11-07 21:42:15 +00:00
heartbeat_handler_test.cc dcsctp: Convert use of TimeMs to webrtc::Timestamp 2023-11-12 21:12:29 +00:00
mock_context.h dcsctp: Migrate non-Timer related to rtc::TimeDelta 2023-11-06 19:55:22 +00:00
mock_dcsctp_socket_callbacks.h dcsctp: Convert use of TimeMs to webrtc::Timestamp 2023-11-12 21:12:29 +00:00
packet_sender.cc Reapply "dcsctp: Negotiate zero checksum" 2023-09-23 21:33:52 +00:00
packet_sender.h Reapply "dcsctp: Negotiate zero checksum" 2023-09-23 21:33:52 +00:00
packet_sender_test.cc dcsctp: Add PacketSender 2021-08-16 20:19:53 +00:00
state_cookie.cc dcsctp: Persist all state in state cookie 2023-12-08 10:54:42 +00:00
state_cookie.h dcsctp: Persist all state in state cookie 2023-12-08 10:54:42 +00:00
state_cookie_test.cc dcsctp: Persist all state in state cookie 2023-12-08 10:54:42 +00:00
stream_reset_handler.cc Move StrJoin to rtc_base/strings 2023-11-15 12:10:28 +00:00
stream_reset_handler.h dcsctp: Convert timers to rtc::TimeDelta 2023-11-07 21:42:15 +00:00
stream_reset_handler_test.cc dcsctp: Convert use of TimeMs to webrtc::Timestamp 2023-11-12 21:12:29 +00:00
transmission_control_block.cc dcsctp: Convert use of TimeMs to webrtc::Timestamp 2023-11-12 21:12:29 +00:00
transmission_control_block.h dcsctp: Convert use of TimeMs to webrtc::Timestamp 2023-11-12 21:12:29 +00:00
transmission_control_block_test.cc Reapply "dcsctp: Negotiate zero checksum" 2023-09-23 21:33:52 +00:00