Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-eventbus
Commits
217da8e8
Commit
217da8e8
authored
Jul 31, 2019
by
Cole Brown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return error when closing already closed emitter
parent
b1629519
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
basic.go
basic.go
+1
-1
No files found.
basic.go
View file @
217da8e8
...
...
@@ -38,7 +38,7 @@ func (e *emitter) Emit(evt interface{}) error {
func
(
e
*
emitter
)
Close
()
error
{
if
!
atomic
.
CompareAndSwapInt32
(
&
e
.
closed
,
0
,
1
)
{
panic
(
"closed an emitter more than once"
)
return
fmt
.
Errorf
(
"closed an emitter more than once"
)
}
if
atomic
.
AddInt32
(
&
e
.
n
.
nEmitters
,
-
1
)
==
0
{
e
.
dropper
(
e
.
typ
)
...
...
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