| 382 | } |
| 383 | |
| 384 | void |
| 385 | APIServer::StopHandlerThread() |
| 386 | { |
| 387 | /* Runs on FILE thread to make sure that it is serialized against */ |
| 388 | /* {Start|Stop}HandlerThread and to allow calling pthread_join. */ |
| 389 | if (!thread_->message_loop()) |
| 390 | return; |
| 391 | thread_->message_loop()->PostTask( |
| 392 | FROM_HERE, |
| 393 | base::Bind(&APIServer::ThreadTearDown, this)); |
| 394 | // Thread::Stop joins the thread. |
| 395 | thread_->Stop(); |
| 396 | } |
| 397 | |
| 398 | void |
| 399 | APIServer::ThreadRun() |