| 3326 | |
| 3327 | |
| 3328 | void ProcessManager::enqueue(ProcessBase* process) |
| 3329 | { |
| 3330 | CHECK(process != nullptr); |
| 3331 | |
| 3332 | // If libprocess is shutting down and the processing threads |
| 3333 | // are currently joining, then do not enqueue the process. |
| 3334 | if (joining_threads.load()) { |
| 3335 | VLOG(1) << "Libprocess shutting down, cannot enqueue process: " |
| 3336 | << process->pid.id; |
| 3337 | |
| 3338 | return; |
| 3339 | } |
| 3340 | |
| 3341 | // TODO(benh): Check and see if this process has its own thread. If |
| 3342 | // it does, push it on that threads runq, and wake up that thread if |
| 3343 | // it's not running. Otherwise, check and see which thread this |
| 3344 | // process was last running on, and put it on that threads runq. |
| 3345 | |
| 3346 | runq.enqueue(process); |
| 3347 | } |
| 3348 | |
| 3349 | |
| 3350 | ProcessBase* ProcessManager::dequeue() |