[614] in Pthreads mailing list archive
Bug in prio_queue.c
daemon@ATHENA.MIT.EDU (Mati Sauks)
Thu Mar 20 15:49:27 1997
From: "Mati Sauks" <mati@psti.com>
To: pthreads@MIT.EDU
Date: Thu, 20 Mar 1997 10:11:47 -0500
Reply-To: mati@psti.com
Hi,
I am porting our operating system to run on top of
your Pthreads implementation.
This will provide our customers whith a host based
simulation/development environment.
I am using version: pthreads-1_60_beta6
I have run across a bug in prio_queue.c, in the
function pthread_prio_queue_remove() at line 155 in the
file.
This is after the if (thread==*current).
Just before the for (prev=*current,current=&((*current)->next);
you need to insert:
if (*current == NULL) {
return(NOTOK);
}
because the priority queue may be empty, and *current thus is NULL.
mati
Mati Sauks (mati@psti.com) Precise Software Technologies Inc.
Suite #308, 301 Moodie Drive, Nepean, Ontario, K2H 9C4 Canada
Phone: (613)-596-2251 Fax: (613)-596-6713
Web: http://www.psti.com
"The Royalty-Free Alternative for Advanced Real-Time Applications"
====================================================================