mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-17 18:30:45 +00:00
add buffer channel to unlock deadlock (#766)
* add buffer channel to unlock deadlock * add buffer channel to unlock deadlock * close channel --------- Co-authored-by: liam.lai <liam.lai@us>
This commit is contained in:
parent
78331172f3
commit
e1ab3e03d1
2 changed files with 6 additions and 3 deletions
|
|
@ -277,12 +277,15 @@ func (self *worker) update() {
|
||||||
MinePeriodCh := self.engine.(*XDPoS.XDPoS).MinePeriodCh
|
MinePeriodCh := self.engine.(*XDPoS.XDPoS).MinePeriodCh
|
||||||
defer close(MinePeriodCh)
|
defer close(MinePeriodCh)
|
||||||
NewRoundCh := self.engine.(*XDPoS.XDPoS).NewRoundCh
|
NewRoundCh := self.engine.(*XDPoS.XDPoS).NewRoundCh
|
||||||
|
defer close(NewRoundCh)
|
||||||
|
|
||||||
timeout := time.NewTimer(time.Duration(minePeriod) * time.Second)
|
timeout := time.NewTimer(time.Duration(minePeriod) * time.Second)
|
||||||
c := make(chan struct{})
|
defer timeout.Stop()
|
||||||
|
c := make(chan struct{}, 1)
|
||||||
|
defer close(c)
|
||||||
finish := make(chan struct{})
|
finish := make(chan struct{})
|
||||||
defer close(finish)
|
defer close(finish)
|
||||||
defer timeout.Stop()
|
|
||||||
go func() {
|
go func() {
|
||||||
for {
|
for {
|
||||||
// A real event arrived, process interesting content
|
// A real event arrived, process interesting content
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ import (
|
||||||
const (
|
const (
|
||||||
VersionMajor = 2 // Major version component of the current release
|
VersionMajor = 2 // Major version component of the current release
|
||||||
VersionMinor = 4 // Minor version component of the current release
|
VersionMinor = 4 // Minor version component of the current release
|
||||||
VersionPatch = 3 // Patch version component of the current release
|
VersionPatch = 4 // Patch version component of the current release
|
||||||
VersionMeta = "beta1" // Version metadata to append to the version string
|
VersionMeta = "beta1" // Version metadata to append to the version string
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue