-
Notifications
You must be signed in to change notification settings - Fork 533
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use atomic ints to set the time for lastSent and lastReceived, and pi…
…ngOutstanding. This resolves the issue of data races as previously coded, it changes the internal struct for the options but leaves the Options setting API the same.
- Loading branch information
Showing
7 changed files
with
30 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 comment
on commit d896be2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At home when running this commit, this change causes a crash while another goroutine is running token.Wait():
sync/atomic.storeUint64(0x10a241d4, 0x5995d4ba, 0x0)
/usr/local/go/src/sync/atomic/64bit_arm.go:20 +0x3c
github.com/eclipse/paho%2emqtt%2egolang.(*client).Connect.func1(0x10a24000, 0x1096c7f8, 0x1096a8a0)
.../go/src/github.com/eclipse/paho.mqtt.golang/client.go:242 +0x920
created by github.com/eclipse/paho%2emqtt%2egolang.(*client).Connect
.../go/src/github.com/eclipse/paho.mqtt.golang/client.go:275 +0x124
This breaks the examples