Re: libpq thread-locking

Поиск
Список
Период
Сортировка
От Andrew Chernow
Тема Re: libpq thread-locking
Дата
Msg-id 482D9996.5000406@esilo.com
обсуждение исходный текст
Ответ на Re: libpq thread-locking  (Magnus Hagander <magnus@hagander.net>)
Ответы Re: libpq thread-locking  (Magnus Hagander <magnus@hagander.net>)
Список pgsql-patches
! 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/

В списке pgsql-patches по дате отправления:

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: libpq thread-locking
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: libpq thread-locking