2010-11-08 22:09:23 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "orte_config.h"
|
|
|
|
|
2010-11-30 20:27:58 +03:00
|
|
|
#include "opal/mca/event/event.h"
|
2010-11-08 22:09:23 +03:00
|
|
|
|
2010-11-30 20:27:58 +03:00
|
|
|
#include "orte/threads/threads.h"
|
2010-11-08 22:09:23 +03:00
|
|
|
|
|
|
|
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;
|
2010-11-30 20:27:58 +03:00
|
|
|
ptr->name = NULL;
|
2010-12-01 07:26:43 +03:00
|
|
|
/* default to updating the global base */
|
|
|
|
ptr->evbase = opal_event_base;
|
2010-11-08 22:09:23 +03:00
|
|
|
}
|
|
|
|
static void destructor(orte_thread_ctl_t *ptr)
|
|
|
|
{
|
|
|
|
OBJ_DESTRUCT(&ptr->lock);
|
|
|
|
OBJ_DESTRUCT(&ptr->cond);
|
2010-11-30 20:27:58 +03:00
|
|
|
if (NULL != ptr->name) {
|
|
|
|
free(ptr->name);
|
|
|
|
}
|
2010-11-08 22:09:23 +03:00
|
|
|
}
|
|
|
|
OBJ_CLASS_INSTANCE(orte_thread_ctl_t,
|
|
|
|
opal_object_t,
|
|
|
|
constructor, destructor);
|