* *****************************************************************************/
| 205 | * |
| 206 | *****************************************************************************/ |
| 207 | void |
| 208 | ThreadList::createCkptThread() |
| 209 | { |
| 210 | sem_init(&sem_launch, 0, 0); |
| 211 | sem_init(&semNotifyCkptThread, 0, 0); |
| 212 | sem_init(&semWaitForCkptThreadSignal, 0, 0); |
| 213 | |
| 214 | SigInfo::setupCkptSigHandler(&stopthisthread); |
| 215 | |
| 216 | originalstartup = true; |
| 217 | pthread_t checkpointhreadid; |
| 218 | |
| 219 | /* Spawn off a thread that will perform the checkpoints from time to time */ |
| 220 | JASSERT(pthread_create(&checkpointhreadid, NULL, checkpointhread, NULL) == 0); |
| 221 | |
| 222 | /* Stop until checkpoint thread has finished initializing. |
| 223 | * Some programs (like gcl) implement their own glibc functions in |
| 224 | * a non-thread-safe manner. In case we're using non-thread-safe glibc, |
| 225 | * don't run the checkpoint thread and user thread at the same time. |
| 226 | */ |
| 227 | errno = 0; |
| 228 | while (-1 == sem_wait(&sem_launch) && errno == EINTR) { |
| 229 | errno = 0; |
| 230 | } |
| 231 | sem_destroy(&sem_launch); |
| 232 | } |
| 233 | |
| 234 | /***************************************************************************** |
| 235 | * |
nothing calls this directly
no test coverage detected