If both data channels become ready simultaneously, then the two integer
read-add-update cycles can execute concurrently and only ever increment
once instead of the required twice. Use an atomic add instead.
};
void gst_webrtc_data_channel_start_negotiation (GstWebRTCDataChannel *channel);
-void gst_webrtc_data_channel_set_sctp_transport (GstWebRTCDataChannel *channel,
- GstWebRTCSCTPTransport *sctp);
+G_GNUC_INTERNAL
+void gst_webrtc_data_channel_link_to_sctp (GstWebRTCDataChannel *channel,
+ GstWebRTCSCTPTransport *sctp_transport);
G_END_DECLS
g_object_get (channel, "ready-state", &ready_state, NULL);
if (ready_state == GST_WEBRTC_DATA_CHANNEL_STATE_OPEN) {
- if (++(*n_ready) >= 2)
+ if (g_atomic_int_add (n_ready, 1) >= 1) {
test_webrtc_signal_state (t, STATE_CUSTOM);
+ }
}
}