Re: pg_arch.c call to sleep()

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: pg_arch.c call to sleep()
Дата
Msg-id 418E7F0A.7050908@dunslane.net
обсуждение исходный текст
Ответ на Re: pg_arch.c call to sleep()  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers

Tom Lane wrote:

>Andrew Dunstan <andrew@dunslane.net> writes:
>  
>
>>We have the following warning on Windows:
>>pgarch.c:349: warning: implicit declaration of function `sleep'
>>    
>>
>
>  
>
>>To fix it we could include the right header (which appears to be 
>><stdlib.h> in the Windows/Mingw case), or we could replace the call by a 
>>call to pg_usleep().
>>    
>>
>
><stdlib.h> is included automatically by c.h, so that surely won't fix it.
>  
>

Now I look closer I see that it declares _sleep() rather than sleep().

>I have some recollection that we invented pg_usleep in part because we
>wanted to not use sleep() at all in the backend, but I don't recall why
>(and the reasoning might not apply to the archiver process, anyway).
>
>
>  
>

I thought we invented pg_usleep so we could remove the calls to 
select(0,NULL,NULL,NULL,timeout) which don't work on Windows.

cheers

andrew


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Memory Context problems...
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: cygwin build failure