aboutsummaryrefslogtreecommitdiffstats
path: root/miner
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-09-02 19:45:15 +0800
committerGitHub <noreply@github.com>2016-09-02 19:45:15 +0800
commit2c6be49d200a3fff660ad78aada3305f8a3e3b9a (patch)
tree2f35733a50f9c06c65193593ccba316f96dba742 /miner
parenta42b7355f40fbc58893ca074db818d461083912c (diff)
parentac0f8b81ae40f18a70413916e5ef1cbc503e4743 (diff)
downloaddexon-2c6be49d200a3fff660ad78aada3305f8a3e3b9a.tar.gz
dexon-2c6be49d200a3fff660ad78aada3305f8a3e3b9a.tar.zst
dexon-2c6be49d200a3fff660ad78aada3305f8a3e3b9a.zip
Merge pull request #2949 from elliots/fix/#2948
miner: Prevent attempts to close nil quit channel in agent (fixes #2948)
Diffstat (limited to 'miner')
-rw-r--r--miner/agent.go16
1 files changed, 4 insertions, 12 deletions
diff --git a/miner/agent.go b/miner/agent.go
index 4a4683bc6..16f2a7723 100644
--- a/miner/agent.go
+++ b/miner/agent.go
@@ -43,8 +43,10 @@ type CpuAgent struct {
func NewCpuAgent(index int, pow pow.PoW) *CpuAgent {
miner := &CpuAgent{
- pow: pow,
- index: index,
+ pow: pow,
+ index: index,
+ quit: make(chan struct{}),
+ workCh: make(chan *Work, 1),
}
return miner
@@ -55,25 +57,15 @@ func (self *CpuAgent) Pow() pow.PoW { return self.pow }
func (self *CpuAgent) SetReturnCh(ch chan<- *Result) { self.returnCh = ch }
func (self *CpuAgent) Stop() {
- self.mu.Lock()
- defer self.mu.Unlock()
-
close(self.quit)
}
func (self *CpuAgent) Start() {
- self.mu.Lock()
- defer self.mu.Unlock()
if !atomic.CompareAndSwapInt32(&self.isMining, 0, 1) {
return // agent already started
}
- self.quit = make(chan struct{})
- // creating current op ch makes sure we're not closing a nil ch
- // later on
- self.workCh = make(chan *Work, 1)
-
go self.update()
}
an title='2001-08-09 10:52:38 +0800'>2001-08-092-1/+8 * Stop editing any event. Fixes bug #5949.Federico Mena Quintero2001-08-092-0/+7 * Duuuh, set the alarm_copy on the component, not the original alarm. FixesFederico Mena Quintero2001-08-092-1/+7 * set the attendees of a component (meeting_page_fill_component): use aboveJP Rosevear2001-08-096-46/+185 * don't use a NULL mask in the call to gdk_gc_set_clip_maskRodrigo Moya2001-08-094-3/+15 * fix pre-processor macrosJP Rosevear2001-08-095-5/+16 * New function to stop further notification from happening.Federico Mena Quintero2001-08-085-45/+68 * Only unref the FIELD_COMPONENT if it is non-NULL. We return a NULL forFederico Mena Quintero2001-08-083-5/+15 * Make calendar.ics the suggested name when attaching the ical objectJP Rosevear2001-08-082-1/+6 * added 'different_timezone' fields to EDayViewEvent and EWeekViewEvent, toDamon Chaplin2001-08-0725-233/+575 * In process of fixing bug #6005. The "Calendar" page is now "Display", andFederico Mena Quintero2001-08-072-236/+168 * added check for NULL pointers. Maybe fixes #5203 (I can't reproduce it, soRodrigo Moya2001-08-073-19/+22 * New function; stops further notification from happening. This is neededFederico Mena Quintero2001-08-0418-165/+656 * Fixes bug #1407.Federico Mena Quintero2001-08-042-120/+7 * I18n fixes.Chyla Zbigniew2001-08-043-1/+16 * Add camel dependency.Jon Trowbridge2001-08-032-0/+6 * If the default category is the same as the value passed in to thisFederico Mena Quintero2001-08-024-3/+34 * removed debugging messages.Damon Chaplin2001-08-022-9/+4 * The calendar search bar widget now includes a drop-down menu of availableFederico Mena Quintero2001-08-02