These two functions (StartProcess and StopProcess) should be private. Since we know in advance the thread these operations should run, remove the "if not IO; post task" from them and make the callers (is one for each) post the task correctly. Keep a CHECK for the right thread in each of them.