草庐IT

newMember

全部标签

go - 我怎样才能摆脱这种数据竞争

我有这两个功能://PartyHubstructcontainsalldataforthepartytypePartyHubstruct{FullPartysmap[string]PartyPartialPartysmap[string]PartyEnterchanMemberLeavechanMembersync.Mutex}//RemoveFromQueuewillremovethememberfrompartyfunc(p*PartyHub)RemoveFromQueue(memberLeavingMember,inQueuebool){if!inQueue{return}for

go - 我怎样才能摆脱这种数据竞争

我有这两个功能://PartyHubstructcontainsalldataforthepartytypePartyHubstruct{FullPartysmap[string]PartyPartialPartysmap[string]PartyEnterchanMemberLeavechanMembersync.Mutex}//RemoveFromQueuewillremovethememberfrompartyfunc(p*PartyHub)RemoveFromQueue(memberLeavingMember,inQueuebool){if!inQueue{return}for