2005-03-14 23:57:21 +03:00
|
|
|
/*
|
2005-11-05 22:57:48 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2005-03-14 23:57:21 +03:00
|
|
|
* 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$
|
|
|
|
*/
|
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "opal_config.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2005-07-04 02:45:48 +04:00
|
|
|
#include "opal/threads/mutex.h"
|
|
|
|
#include "opal/threads/condition.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
|
|
|
|
|
2005-07-04 02:45:48 +04:00
|
|
|
static void opal_condition_construct(opal_condition_t *c)
|
2005-03-14 23:57:21 +03:00
|
|
|
{
|
|
|
|
c->c_waiting = 0;
|
|
|
|
c->c_signaled = 0;
|
|
|
|
#if OMPI_HAVE_POSIX_THREADS
|
|
|
|
pthread_cond_init(&c->c_cond, NULL);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-07-04 02:45:48 +04:00
|
|
|
static void opal_condition_destruct(opal_condition_t *c)
|
2005-03-14 23:57:21 +03:00
|
|
|
{
|
|
|
|
#if OMPI_HAVE_POSIX_THREADS
|
|
|
|
pthread_cond_destroy(&c->c_cond);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2005-07-04 02:45:48 +04:00
|
|
|
OBJ_CLASS_INSTANCE(opal_condition_t,
|
2005-07-03 20:06:07 +04:00
|
|
|
opal_object_t,
|
2005-07-04 02:45:48 +04:00
|
|
|
opal_condition_construct,
|
|
|
|
opal_condition_destruct);
|