()
| 30 | } |
| 31 | |
| 32 | func (this *RWQueue) exchange() bool { |
| 33 | temp_queue := this.write_queue |
| 34 | if temp_queue.empty() == true { |
| 35 | return false |
| 36 | } |
| 37 | this.write_queue = this.read_queue |
| 38 | this.read_queue = temp_queue |
| 39 | return true |
| 40 | } |
| 41 | |
| 42 | func (this *RWQueue) Push(event interface{}) { |
| 43 | this.write_lock.Lock() |