diff options
| author | rpj <rpj> | 1999-05-27 20:44:42 +0000 | 
|---|---|---|
| committer | rpj <rpj> | 1999-05-27 20:44:42 +0000 | 
| commit | 17b9298d9918a36c344741f20f165bc67b5b7769 (patch) | |
| tree | 047d35b87fc2ad8c1a7716f163ff4d50867d7966 | |
| parent | 67f6e902524b3f59d7de7bf8e3574ff7a7911028 (diff) | |
Fri May 28 13:33:05 1999  Ross Johnson  <rpj@swan.canberra.edu.au>
        * condvar.c (pthread_cond_broadcast): Fix possible memory fault
        - Mark E. Armstrong <avail@pacbell.net>
Thu May 27 13:08:46 1999  Ross Johnson  <rpj@swan.canberra.edu.au>
        * condvar.c (pthread_cond_broadcast): Fix logic bug
        - Peter Slacik <Peter.Slacik@tatramed.sk>;
        optimise sem_post loop
        - Bossom, John <John.Bossom@Cognos.COM>.
| -rw-r--r-- | ChangeLog | 15 | ||||
| -rw-r--r-- | condvar.c | 13 | 
2 files changed, 20 insertions, 8 deletions
| @@ -1,6 +1,19 @@ +Fri May 28 13:33:05 1999  Ross Johnson  <rpj@swan.canberra.edu.au> + +	* condvar.c (pthread_cond_broadcast): Fix possible memory fault +	- Mark E. Armstrong <avail@pacbell.net> +	 +Thu May 27 13:08:46 1999  Ross Johnson  <rpj@swan.canberra.edu.au> + +	* condvar.c (pthread_cond_broadcast): Fix logic bug +	- Peter Slacik <Peter.Slacik@tatramed.sk>; +	optimise sem_post loop +	- Bossom, John <John.Bossom@Cognos.COM>. +  Fri May 14 12:13:18 1999  Ross Johnson  <rpj@swan.canberra.edu.au> -	* attr.c (pthread_attr_setdetachstate): Fix logic bug. +	* attr.c (pthread_attr_setdetachstate): Fix logic bug +	- Mike Russo <miker@eai.com>.  Wed Apr  7 14:09:52 1999  Ross Johnson  <rpj@swan.canberra.edu.au> @@ -827,8 +827,6 @@ pthread_cond_broadcast (pthread_cond_t * cond)    cv = *cond; -  cv->wasBroadcast = TRUE; -    /*     * No-op if the CV is static and hasn't been initialised yet.     */ @@ -837,13 +835,14 @@ pthread_cond_broadcast (pthread_cond_t * cond)        return 0;      } +  cv->wasBroadcast = TRUE; +    /*     * Wake up all waiters     */ -  for (i = cv->waiters; i > 0 && result == 0; i--) -    { -      result = sem_post (&(cv->sema)); -    } +  result = (ReleaseSemaphore( cv->sema, cond->waiters, NULL ) +	    ? 0 +	    : EINVAL);    if (cv->waiters > 0 && result == 0)      { @@ -851,7 +850,7 @@ pthread_cond_broadcast (pthread_cond_t * cond)         * Wait for all the awakened threads to acquire their part of         * the counting semaphore         */ -      if (WaitForSingleObject (cv->waitersDone, INFINITE) != +      if (WaitForSingleObject (cv->waitersDone, INFINITE) ==            WAIT_OBJECT_0)          {            result = 0; | 
