Codebase list golang-github-vbauerster-mpb / 4ed783c
h_end case Vladimir Bauer 3 years ago
1 changed file(s) with 11 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
1313 h_iter
1414 h_pop_all
1515 h_fix
16 h_end
1617 )
1718
1819 type heapRequest struct {
8182 close(data.iter)
8283 case h_fix:
8384 heap.Fix(&bHeap, req.data.(int))
85 case h_end:
86 close(m)
87 data := req.data.(chan []*Bar)
88 data <- bHeap
8489 }
8590 }
8691 }
107112 func (m heapManager) fix(index int) {
108113 m <- heapRequest{cmd: h_push, data: index}
109114 }
115
116 func (m heapManager) end() []*Bar {
117 data := make(chan []*Bar)
118 m <- heapRequest{cmd: h_end, data: data}
119 return <-data
120 }