CallTest makes a request to the server and blocks the invoking goroutine until a server responds with a response. Doesn't block a kernel.Task. Analogous to Connection.Call but used for testing.
(conn *connection, t *kernel.Task, r *Request, i uint32)
| 162 | // goroutine until a server responds with a response. Doesn't block |
| 163 | // a kernel.Task. Analogous to Connection.Call but used for testing. |
| 164 | func CallTest(conn *connection, t *kernel.Task, r *Request, i uint32) (*Response, error) { |
| 165 | conn.mu.Lock() |
| 166 | |
| 167 | // Wait until we're certain that a new request can be processed. |
| 168 | for conn.numActiveRequests == conn.maxActiveRequests { |
| 169 | conn.mu.Unlock() |
| 170 | <-conn.fullQueueCh |
| 171 | conn.mu.Lock() |
| 172 | } |
| 173 | |
| 174 | fut, err := conn.callFutureLocked(r) // No task given. |
| 175 | conn.mu.Unlock() |
| 176 | |
| 177 | if err != nil { |
| 178 | return nil, err |
| 179 | } |
| 180 | |
| 181 | // Resolve the response. |
| 182 | // |
| 183 | // Block without a task. |
| 184 | <-fut.ch |
| 185 | |
| 186 | // A response is ready. Resolve and return it. |
| 187 | return fut.getResponse(), nil |
| 188 | } |
| 189 | |
| 190 | // ReadTest is analogous to vfs.FileDescription.Read and reads from the FUSE |
| 191 | // device. However, it does so by - not blocking the task that is calling - and |
no test coverage detected
searching dependent graphs…