Re: [PATCHES] libpq thread-locking

2008-05-16 Thread Magnus Hagander
Bruce Momjian wrote: > Magnus Hagander wrote: > > Bruce Momjian wrote: > > > Bruce Momjian wrote: > > > > Magnus Hagander wrote: > > > > > Attached patch adds some error checking to the thread locking > > > > > stuff in libpq. Previously, if thread locking failed for some > > > > > reason, we would

Re: [PATCHES] libpq thread-locking

2008-05-16 Thread Bruce Momjian
Magnus Hagander wrote: > Bruce Momjian wrote: > > Bruce Momjian wrote: > > > Magnus Hagander wrote: > > > > Attached patch adds some error checking to the thread locking > > > > stuff in libpq. Previously, if thread locking failed for some > > > > reason, we would just fall through and do things wi

Re: [PATCHES] libpq thread-locking

2008-05-16 Thread Magnus Hagander
Andrew Chernow wrote: > ! int >pthread_mutex_init(pthread_mutex_t *mp, void *attr) >{ > *mp = CreateMutex(0, 0, 0); > + if (*mp == NULL) > + return 1; > + return 0; >} > > Maybe it would be better to emulate what pthreads does. Instead of > returing 1 to ind

Re: [PATCHES] libpq thread-locking

2008-05-16 Thread Andrew Chernow
! int pthread_mutex_init(pthread_mutex_t *mp, void *attr) { *mp = CreateMutex(0, 0, 0); + if (*mp == NULL) + return 1; + return 0; } Maybe it would be better to emulate what pthreads does. Instead of returing 1 to indicate an error, return an errno. In t

Re: [PATCHES] libpq thread-locking

2008-05-16 Thread Magnus Hagander
Bruce Momjian wrote: > Bruce Momjian wrote: > > Magnus Hagander wrote: > > > Attached patch adds some error checking to the thread locking > > > stuff in libpq. Previously, if thread locking failed for some > > > reason, we would just fall through and do things without locking. > > > This patch mak

Re: [PATCHES] libpq thread-locking

2008-05-08 Thread Bruce Momjian
Bruce Momjian wrote: > Magnus Hagander wrote: > > Attached patch adds some error checking to the thread locking stuff in > > libpq. Previously, if thread locking failed for some reason, we would > > just fall through and do things without locking. This patch makes us > > abort() instead. It's not t

Re: [PATCHES] libpq thread-locking

2008-05-08 Thread Bruce Momjian
Magnus Hagander wrote: > Attached patch adds some error checking to the thread locking stuff in > libpq. Previously, if thread locking failed for some reason, we would > just fall through and do things without locking. This patch makes us > abort() instead. It's not the greatest thing probably, but

[PATCHES] libpq thread-locking

2008-05-07 Thread Magnus Hagander
Attached patch adds some error checking to the thread locking stuff in libpq. Previously, if thread locking failed for some reason, we would just fall through and do things without locking. This patch makes us abort() instead. It's not the greatest thing probably, but our API doesn't let us pass ba