X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fglthread%2Fcond.h;h=d866b6e6772c8907df1213dcd5362cbc8ad8d241;hb=3c65a6806b208533f681855712e0febf4bb0ed67;hp=fca1cbf402e4c6388cd1989ba0081ef81acc8aa7;hpb=4116861d97496a3e87a5ee74f2e40843bd1e1a7a;p=gnulib.git diff --git a/lib/glthread/cond.h b/lib/glthread/cond.h index fca1cbf40..d866b6e67 100644 --- a/lib/glthread/cond.h +++ b/lib/glthread/cond.h @@ -1,5 +1,5 @@ /* Condition variables for multithreading. - Copyright (C) 2005-2008 Free Software Foundation, Inc. + Copyright (C) 2005-2010 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -279,18 +279,21 @@ extern "C" { /* -------------------------- gl_cond_t datatype -------------------------- */ +struct gl_waitqueue_link +{ + struct gl_waitqueue_link *wql_next; + struct gl_waitqueue_link *wql_prev; +}; +typedef struct + { + struct gl_waitqueue_link wq_list; /* circular list of waiting threads */ + } + gl_linked_waitqueue_t; typedef struct { gl_spinlock_t guard; /* protects the initialization */ CRITICAL_SECTION lock; /* protects the remaining fields */ - HANDLE event; /* an event configured for manual reset */ - unsigned int waiters_count; /* number of threads currently waiting */ - unsigned int release_count; /* number of threads that are currently - being notified but have not yet - acknowledged. Always - release_count <= waiters_count */ - unsigned int wait_generation_count; /* incremented each time a signal - or broadcast is performed */ + gl_linked_waitqueue_t waiters; /* waiting threads */ } gl_cond_t; # define gl_cond_define(STORAGECLASS, NAME) \