1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

simplified abnormal process termination

This commit is contained in:
Steffen Vogel 2015-11-29 21:20:42 +01:00
parent 98cf27a102
commit fb0a0ef83b
4 changed files with 3 additions and 20 deletions

View file

@ -66,13 +66,6 @@
struct settings;
struct timespec;
/** The main thread id.
* This is used to notify the main thread about
* the program termination.
* See error() macros.
*/
extern pthread_t _mtid;
/** Normal random variate generator using the Box-Muller method
*
* @param m Mean

View file

@ -92,17 +92,11 @@ double randf()
return (double) random() / RAND_MAX;
}
/** This global variable holds the main thread ID.
* Its used by die().
*/
pthread_t _mtid;
void die()
{
if (pthread_equal(_mtid, pthread_self()))
exit(EXIT_FAILURE);
else
pthread_kill(_mtid, SIGINT);
int zero = 0;
log_outdent(&zero);
abort();
}
char * strcatf(char **dest, const char *fmt, ...)

View file

@ -120,8 +120,6 @@ static void usage(const char *name)
int main(int argc, char *argv[])
{
_mtid = pthread_self();
/* Check arguments */
#ifdef ENABLE_OPAL_ASYNC
if (argc != 2 && argc != 4)

View file

@ -62,8 +62,6 @@ int main(int argc, char *argv[])
{
config_t config;
_mtid = pthread_self();
if (argc < 4) {
printf("Usage: %s CONFIG TEST NODE [ARGS]\n", argv[0]);
printf(" CONFIG path to a configuration file\n");