/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#ifndef _VTHREAD_H
/* Header for the Vthread library.
** Note that the macro vt_threaded may be defined
** outside of vthread.h to suppress threading.
**
** Written by Kiem-Phong Vo, kpv@research.att.com
*/
#include <ast_common.h>
#include <errno.h>
/* ast doesn't do threads yet */
#if _PACKAGE_ast && !defined(vt_threaded)
#define vt_threaded 0
#endif
#else
#define _may_use_threads 0
#endif
#include <pthread.h>
#if !defined(PTHREAD_ONCE_INIT) && defined(pthread_once_init)
#endif
#endif
#include <windows.h>
typedef int _vtonce_t;
#endif
#ifndef vt_threaded
#define vt_threaded 0
#endif
/* common attributes for various structures */
/* directives for vtset() */
#ifndef EINVAL
#endif
#ifndef EBUSY
#endif
#ifndef EDEADLK
#endif
#ifndef EPERM
#endif
#if vt_threaded
/* mutex structure */
struct _vtmutex_s
int count;
int state;
int error;
};
/* structure for states of thread */
struct _vthread_s
};
/* structure for exactly once execution */
struct _vtonce_s
{ int done;
int error;
};
#if _WIN32
#define VTONCE_INITDATA {0, 0}
#else
#endif
#endif /*vt_threaded*/
/* fake structures and functions */
#if !vt_threaded
struct _vtmutex_s
{ int error;
};
struct _vtattr_s
{ int error;
};
struct _vthread_s
{ int error;
};
struct _vtonce_s
{ int error;
};
typedef int _vtmtx_t;
typedef int _vtonce_t;
typedef int _vtself_t;
typedef int _vtid_t;
typedef int _vtattr_t;
#define VTONCE_INITDATA {0}
#endif /*!vt_threaded*/
#endif /*_VTHREAD_H*/