2005-03-14 23:57:21 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2005-03-14 23:57:21 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ompi_config.h"
|
|
|
|
|
2005-04-11 07:43:35 +04:00
|
|
|
#include "threads/mutex.h"
|
|
|
|
#include "threads/condition.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
|
|
|
|
|
|
|
|
static void ompi_condition_construct(ompi_condition_t *c)
|
|
|
|
{
|
|
|
|
c->c_waiting = 0;
|
|
|
|
c->c_signaled = 0;
|
|
|
|
#if OMPI_HAVE_POSIX_THREADS
|
|
|
|
pthread_cond_init(&c->c_cond, NULL);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void ompi_condition_destruct(ompi_condition_t *c)
|
|
|
|
{
|
|
|
|
#if OMPI_HAVE_POSIX_THREADS
|
|
|
|
pthread_cond_destroy(&c->c_cond);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
OBJ_CLASS_INSTANCE(ompi_condition_t,
|
2005-07-03 20:06:07 +04:00
|
|
|
opal_object_t,
|
2005-03-14 23:57:21 +03:00
|
|
|
ompi_condition_construct,
|
|
|
|
ompi_condition_destruct);
|