(connection Connection)
| 177 | } |
| 178 | |
| 179 | func (pool *Pool) putConnection(connection Connection) { |
| 180 | pool.synchro.Lock() |
| 181 | defer pool.synchro.Unlock() |
| 182 | |
| 183 | // If someone is already waiting for a connection, then we return it to him |
| 184 | select { |
| 185 | case pool.readyConnection <- connection: |
| 186 | return |
| 187 | default: |
| 188 | } |
| 189 | |
| 190 | // Nobody needs this connection |
| 191 | |
| 192 | pool.putConnectionUnsafe(connection) |
| 193 | } |
| 194 | |
| 195 | func (pool *Pool) nowTs() Timestamp { |
| 196 | return Timestamp(time.Now().Unix()) |
no test coverage detected