* * New process. Empty the activeThreads list * *****************************************************************************/
| 157 | * |
| 158 | *****************************************************************************/ |
| 159 | void |
| 160 | ThreadList::resetOnFork() |
| 161 | { |
| 162 | while (activeThreads != NULL) { |
| 163 | ThreadList::threadIsDead(activeThreads); // takes care of updating |
| 164 | // "activeThreads" ptr. |
| 165 | } |
| 166 | |
| 167 | // CONTEXT: initThread() resets curThread only if it's non-NULL. |
| 168 | // ... -> initializeMtcpEngine() -> ThreadList::init() -> initThread() |
| 169 | // See addToActiveList() for more information. |
| 170 | curThread = motherofall = nullptr; |
| 171 | |
| 172 | init(); |
| 173 | createCkptThread(); |
| 174 | } |
| 175 | |
| 176 | /***************************************************************************** |
| 177 | * |