Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
G
getty
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wei.xuan
getty
Commits
abef1dd9
Commit
abef1dd9
authored
Sep 03, 2019
by
pantianying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change variable name
parent
2d40a6f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
session.go
session.go
+10
-10
No files found.
session.go
View file @
abef1dd9
...
...
@@ -86,9 +86,9 @@ type session struct {
// attribute
attrs
*
ValuesContext
// goroutines done signal
handlePackage
Done
chan
struct
{}
lock
sync
.
RWMutex
//
read
goroutines done signal
r
Done
chan
struct
{}
lock
sync
.
RWMutex
}
func
newSession
(
endPoint
EndPoint
,
conn
Connection
)
*
session
{
...
...
@@ -102,10 +102,10 @@ func newSession(endPoint EndPoint, conn Connection) *session {
period
:
period
,
done
:
make
(
chan
struct
{}),
wait
:
pendingDuration
,
attrs
:
NewValuesContext
(
nil
),
handlePackage
Done
:
make
(
chan
struct
{}),
done
:
make
(
chan
struct
{}),
wait
:
pendingDuration
,
attrs
:
NewValuesContext
(
nil
),
r
Done
:
make
(
chan
struct
{}),
}
ss
.
Connection
.
setSession
(
ss
)
...
...
@@ -146,7 +146,7 @@ func (s *session) Reset() {
s
.
period
=
period
s
.
wait
=
pendingDuration
s
.
attrs
=
NewValuesContext
(
nil
)
s
.
handlePackage
Done
=
make
(
chan
struct
{})
s
.
r
Done
=
make
(
chan
struct
{})
s
.
SetWriteTimeout
(
netIOTimeout
)
s
.
SetReadTimeout
(
netIOTimeout
)
...
...
@@ -508,7 +508,7 @@ LOOP:
select
{
case
<-
s
.
done
:
// this case branch assure the (session)handleLoop gr will exit before (session)handlePackage gr.
<-
s
.
handlePackage
Done
<-
s
.
r
Done
if
len
(
s
.
wQ
)
==
0
{
log
.
Infof
(
"%s, [session.handleLoop] got done signal. wQ is nil."
,
s
.
Stat
())
break
LOOP
...
...
@@ -570,7 +570,7 @@ func (s *session) handlePackage() {
log
.
Errorf
(
"[session.handlePackage] panic session %s: err=%s
\n
%s"
,
s
.
sessionToken
(),
r
,
rBuf
)
}
close
(
s
.
handlePackage
Done
)
close
(
s
.
r
Done
)
log
.
Infof
(
"%s, [session.handlePackage] gr will exit now"
,
s
.
sessionToken
())
s
.
stop
()
if
err
!=
nil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment