1
1

* Test enabling signal handling in the event library. Because this might

have some nasty side effect we don't know about, make it a configure
  option for now.  Also add a harmless signal handler to the pcm open
  (since pcm_open will have a signal handler eventually for SIGCHLD, I
  think).  Use --enable-event-signals / --disable-event-signals to 
  control behavior.

This commit was SVN r2748.
Этот коммит содержится в:
Brian Barrett 2004-09-17 17:04:05 +00:00
родитель 62ea85332c
Коммит 857fd5740f
3 изменённых файлов: 49 добавлений и 0 удалений

Просмотреть файл

@ -260,5 +260,25 @@ fi
AM_CONDITIONAL(WANT_DEPRECATED_EXECUTABLE_NAMES, test "$WANT_DEN" = "1")
#
# Do we want event signal handlers
# BWB - this needs to be removed before release - XXX
#
AC_MSG_CHECKING([if want event library signal handling])
AC_ARG_ENABLE(event-signals,
AC_HELP_STRING([--enable-event-signals],
[Do we want to use the event library signal handlers (default: enabled)]))
if test "$enable_event_signals" != "no"; then
AC_MSG_RESULT([yes])
use_event_signals=1
else
AC_MSG_RESULT([no])
use_event_siganls=0
fi
AC_DEFINE_UNQUOTED(OMPI_EVENT_USE_SIGNALS, $use_event_signals,
[Do we want to use the event library signal handlers])
#
])

Просмотреть файл

@ -64,9 +64,11 @@ extern "C" {
#define OMPI_EV_SIGNAL 0x08
#define OMPI_EV_PERSIST 0x10 /* Persistant event */
#if 0
#ifndef OMPI_EVENT_USE_SIGNALS
#define OMPI_EVENT_USE_SIGNALS 0
#endif
#endif
/* Fix so that ppl dont have to run with <sys/queue.h> */
#ifndef TAILQ_ENTRY

Просмотреть файл

@ -9,6 +9,8 @@
#include "mca/pcm/pcm.h"
#include "mca/pcm/base/base.h"
#include "util/output.h"
#include "event/event.h"
#include <signal.h>
/*
* The following file was created by configure. It contains extern
@ -19,6 +21,15 @@
#include "mca/pcm/base/static-components.h"
void
signal_cb(int fd, short event, void *arg)
{
struct ompi_event *signal = arg;
printf("%s: got signal %d\n", "signal_cb", OMPI_EVENT_SIGNAL(signal));
}
/*
* Global variables
*/
@ -32,6 +43,22 @@ ompi_list_t mca_pcm_base_components_available;
*/
int mca_pcm_base_open(void)
{
/*
* XXX: BEGIN DEBUGGING CODE BWB NEEDS TO REMOVE
*/
struct ompi_event *signal_int;
signal_int = malloc(sizeof(struct ompi_event));
/* Initalize one event */
ompi_event_set(signal_int, SIGHUP, OMPI_EV_SIGNAL|OMPI_EV_PERSIST, signal_cb,
signal_int);
ompi_event_add(signal_int, NULL);
/*
* XXX: END DEBUGGING CODE BWB NEEDS TO REMOVE
*/
/* Open up all available components */
if (OMPI_SUCCESS !=