Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Patches > Re: libpq threa...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 8 Topic 3697 of 4088
Post > Topic >>

Re: libpq thread-locking

by ac@[EMAIL PROTECTED] (Andrew Chernow) May 16, 2008 at 10:26 AM

! 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 the above case, 
ENOMEM seems like a good fit.

Also, maybe you should check the passed in mutex pointer.  If its NULL, 
you could return EINVAL.

-- 
Andrew Chernow
eSilo, LLC
every bit counts
http://www.esilo.com/

-- 
Sent via pgsql-patches mailing list (pgsql-patches@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches
 




 8 Posts in Topic:
libpq thread-locking
magnus@[EMAIL PROTECTED]   2008-05-07 21:26:59 
Re: libpq thread-locking
bruce@[EMAIL PROTECTED]   2008-05-08 14:07:22 
Re: libpq thread-locking
bruce@[EMAIL PROTECTED]   2008-05-08 14:09:21 
Re: libpq thread-locking
magnus@[EMAIL PROTECTED]   2008-05-16 16:04:38 
Re: libpq thread-locking
ac@[EMAIL PROTECTED] (An  2008-05-16 10:26:30 
Re: libpq thread-locking
bruce@[EMAIL PROTECTED]   2008-05-16 11:04:21 
Re: libpq thread-locking
magnus@[EMAIL PROTECTED]   2008-05-16 20:31:03 
Re: libpq thread-locking
magnus@[EMAIL PROTECTED]   2008-05-16 16:35:20 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 9:41:17 CDT 2008.