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