home *** CD-ROM | disk | FTP | other *** search
- /*
- * @(#)condvar_md.h 1.12 96/11/23
- *
- * Copyright (c) 1995, 1996 Sun Microsystems, Inc. All Rights Reserved.
- *
- * This software is the confidential and proprietary information of Sun
- * Microsystems, Inc. ("Confidential Information"). You shall not
- * disclose such Confidential Information and shall use it only in
- * accordance with the terms of the license agreement you entered into
- * with Sun.
- *
- * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
- * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
- * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
- * THIS SOFTWARE OR ITS DERIVATIVES.
- *
- * CopyrightVersion 1.1_beta
- *
- */
-
- #ifndef _WIN32_CONDVAR_MD_H_
- #define _WIN32_CONDVAR_MD_H_
-
- #include <windows.h>
- #include "bool.h"
- #include "mutex_md.h"
- #include "threads_md.h"
-
- /*
- * Condition variable object.
- */
- typedef struct condvar {
- HANDLE event; /* Manual-reset event for notifications */
- unsigned int counter; /* Current number of notifications */
- unsigned int waiters; /* Number of threads waiting for notification */
- unsigned int tickets; /* Number of waiters to be notified */
- } condvar_t;
-
- bool_t condvarInit(condvar_t *);
- void condvarDestroy(condvar_t *);
- void condvarWait(sys_thread_t *, condvar_t *, mutex_t *);
- void condvarTimedWait(sys_thread_t *, condvar_t *, mutex_t *, unsigned long);
- bool_t condvarSignal(condvar_t *);
- bool_t condvarBroadcast(condvar_t *);
-
- #endif /* !_WIN32_CONDVAR_MD_H_ */
-