| 70 | |
| 71 | |
| 72 | void safeExit(int retcode) |
| 73 | { |
| 74 | bool shutdown; |
| 75 | |
| 76 | globalMutex.lock(false); |
| 77 | shutdown = deadYet; |
| 78 | if(!deadYet) |
| 79 | { |
| 80 | deadYet = true; |
| 81 | cleanup(); |
| 82 | fconfig_deleteinstance(); |
| 83 | } |
| 84 | globalMutex.unlock(false); |
| 85 | if(!shutdown) |
| 86 | { |
| 87 | if(!strcasecmp(fconfig.exitfunction, "_exit")) |
| 88 | _exit(retcode); |
| 89 | else if(!strcasecmp(fconfig.exitfunction, "abort")) |
| 90 | abort(); |
| 91 | else |
| 92 | exit(retcode); |
| 93 | } |
| 94 | else pthread_exit(0); |
| 95 | } |
| 96 | |
| 97 | |
| 98 | class GlobalCleanup |
no test coverage detected