A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Haivision/srt/commit/6c8f0f14080f2b8dfc72b44cecd313ecd494220e below:

[core] fix volatile in group.h · Haivision/srt@6c8f0f1 · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+10

-10

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+10

-10

lines changed Original file line number Diff line number Diff line change

@@ -85,7 +85,7 @@ bool CUDTGroup::applyGroupSequences(SRTSOCKET target, int32_t& w_snd_isn, int32_

85 85 86 86

// SndCurrSeqNo is initially set to ISN-1, this next one is

87 87

// the sequence that is about to be stamped on the next sent packet

88 -

// over that socket. Using this field is safer because it is volatile

88 +

// over that socket. Using this field is safer because it is atomic

89 89

// and its affinity is to the same thread as the sending function.

90 90 91 91

// NOTE: the groupwise scheduling sequence might have been set

Original file line number Diff line number Diff line change

@@ -611,10 +611,10 @@ class CUDTGroup

611 611 612 612

private:

613 613

// Fields required for SRT_GTYPE_BACKUP groups.

614 -

senderBuffer_t m_SenderBuffer;

615 -

int32_t m_iSndOldestMsgNo; // oldest position in the sender buffer

616 -

volatile int32_t m_iSndAckedMsgNo;

617 -

uint32_t m_uOPT_MinStabilityTimeout_us;

614 +

senderBuffer_t m_SenderBuffer;

615 +

int32_t m_iSndOldestMsgNo; // oldest position in the sender buffer

616 +

sync::atomic<int32_t> m_iSndAckedMsgNo;

617 +

uint32_t m_uOPT_MinStabilityTimeout_us;

618 618 619 619

// THIS function must be called only in a function for a group type

620 620

// that does use sender buffer.

@@ -671,7 +671,7 @@ class CUDTGroup

671 671

// This is the sequence number of a packet that has been previously

672 672

// delivered. Initially it should be set to SRT_SEQNO_NONE so that the sequence read

673 673

// from the first delivering socket will be taken as a good deal.

674 -

volatile int32_t m_RcvBaseSeqNo;

674 +

sync::atomic<int32_t> m_RcvBaseSeqNo;

675 675 676 676

bool m_bOpened; // Set to true when at least one link is at least pending

677 677

bool m_bConnected; // Set to true on first link confirmed connected

@@ -685,10 +685,10 @@ class CUDTGroup

685 685 686 686

// Signal for the blocking user thread that the packet

687 687

// is ready to deliver.

688 -

srt::sync::Condition m_RcvDataCond;

689 -

srt::sync::Mutex m_RcvDataLock;

690 -

volatile int32_t m_iLastSchedSeqNo; // represetnts the value of CUDT::m_iSndNextSeqNo for each running socket

691 -

volatile int32_t m_iLastSchedMsgNo;

688 +

sync::Condition m_RcvDataCond;

689 +

sync::Mutex m_RcvDataLock;

690 +

sync::atomic<int32_t> m_iLastSchedSeqNo; // represetnts the value of CUDT::m_iSndNextSeqNo for each running socket

691 +

sync::atomic<int32_t> m_iLastSchedMsgNo;

692 692

// Statistics

693 693 694 694

struct Stats

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4