This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [PATCH] added locks in pthread code


I wanted to make sure that a thread can not be cancelled asynchronous when
it is in the cleanup push call, but i think it could be done better with
InterlockedExchangePointer.

I will review and send an update of my pending patches with the current
CVS sources tonight.

Thomas

On Mon, 10 Jun 2002, Robert Collins wrote:

> Oh, and I'm not 100% sure that the cleanup_handler_push needs the locks
> - shouldn't it be non cancellable? The IEEE P1003.1 reference I'm using
> does not list pthread_clean_push as being cancellable, and explicitly
> states that non listed functions (from the standard) are not
> cancellable.
>
> Rob
>
> > -----Original Message-----
> > From: cygwin-patches-owner@cygwin.com
> > [mailto:cygwin-patches-owner@cygwin.com] On Behalf Of Robert Collins
> > Sent: Monday, 10 June 2002 12:24 PM
> > To: 'Thomas Pfaff'; cygwin-patches@cygwin.com
> > Subject: RE: [PATCH] added locks in pthread code
> >
> >
> > I'm applying a variation on this. Again, mainly OOP style changes, but
> > also making the mutex an instance rather than pointer. (And where you
> > aware that you where leaking the mutex?)
> >
> > Rob
> >
> > > -----Original Message-----
> > > From: Thomas Pfaff [mailto:tpfaff@gmx.net]
> > > Sent: Thursday, 25 April 2002 7:33 PM
> > > To: cygwin-patches@cygwin.com
> > > Subject: [PATCH] added locks in pthread code
> > >
> > >
> > > The patch will add locks via mutex around critical code to
> > > protect against
> > > race conditions and fix __pthread_detach to cleanup when thread has
> > > already terminated. This an incremental update again.
> > >
> > > Greetings,
> > > Thomas
> > >
> > > 2002-04-25  Thomas Pfaff  <tpfaff@gmx.net>
> > >
> > > 	* thread.h (pthread::mutex): new member
> > > 	* thread.cc (pthread::pthread): Set mutex to NULL.
> > > 	(pthread::~pthread): Destroy mutex.
> > > 	(pthread::create): Initialize mutex.
> > > 	(thread_init_wrapper): Protect against race.
> > > 	(__pthread_cleanup_push): Ditto.
> > > 	(__pthread_exit): Ditto.
> > > 	(__pthread_join): Ditto
> > > 	(__pthread_detach): Protect against race and cleanup if
> > > thread has
> > > 	already terminated.
> > >
> >
> >
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]