Skip to content

Commit

Permalink
Initialize new RWMutex when creating a SmContext
Browse files Browse the repository at this point in the history
  • Loading branch information
ghislainbourgeois committed Jan 3, 2024
1 parent 2d503fa commit 082e74e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions context/amf_ue.go
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,7 @@ func (ue *AmfUe) CopyDataFromUeContextModel(ueContext models.UeContext) {
if len(ueContext.SessionContextList) > 0 {
for _, pduSessionContext := range ueContext.SessionContextList {
smContext := SmContext{
Mu: new(sync.RWMutex),
PduSessionIDVal: pduSessionContext.PduSessionId,
SmContextRefVal: pduSessionContext.SmContextRef,
SnssaiVal: *pduSessionContext.SNssai,
Expand Down
5 changes: 4 additions & 1 deletion context/sm_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ type SmContext struct {
}

func NewSmContext(pduSessionID int32) *SmContext {
c := &SmContext{PduSessionIDVal: pduSessionID}
c := &SmContext{
PduSessionIDVal: pduSessionID,
Mu: new(sync.RWMutex),
}
return c
}

Expand Down

0 comments on commit 082e74e

Please sign in to comment.