1
1
openmpi/orte/threads/thread.c
Ralph Castain 09f02b3087 Update the ORTE thread acquire/release/wakeup macros to trigger release from event_loop so that conditions can be checked.
Add macro versions of condition_wait and friends for debug use.

This commit was SVN r24115.
2010-11-30 17:27:58 +00:00

38 строки
876 B
C

/*
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "orte_config.h"
#include "opal/mca/event/event.h"
#include "orte/threads/threads.h"
static void constructor(orte_thread_ctl_t *ptr)
{
OBJ_CONSTRUCT(&ptr->lock, opal_mutex_t);
OBJ_CONSTRUCT(&ptr->cond, opal_condition_t);
ptr->active = false;
ptr->running = false;
ptr->stop = false;
ptr->name = NULL;
/* default to waking up the global base */
ptr->wakeup_pipe = opal_event_base->wakeup_pipe[1];
}
static void destructor(orte_thread_ctl_t *ptr)
{
OBJ_DESTRUCT(&ptr->lock);
OBJ_DESTRUCT(&ptr->cond);
if (NULL != ptr->name) {
free(ptr->name);
}
}
OBJ_CLASS_INSTANCE(orte_thread_ctl_t,
opal_object_t,
constructor, destructor);