Re: flock user defined function

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: flock user defined function
Дата
Msg-id 20040622221222.GC27296@svana.org
обсуждение исходный текст
Ответ на flock user defined function  (Chris Goughnour <cgoughnour@hotp.com>)
Ответы Re: flock user defined function  (Doug McNaught <doug@mcnaught.org>)
Список pgsql-general
On Tue, Jun 22, 2004 at 02:49:27PM -0700, Chris Goughnour wrote:
> I'm trying to write two C language user defined functions, lockfile() and
> unlockfile(), that call flock using LOCK_EX and LOCK_UN respectively.  If I
> call lockfile from a first psql process it returns successfully.  Calling
> lockfile from a second psql process blocks. However, when I call unlockfile
> from the first psql process, the second process still blocks.  The lockfile
> call from the second psql proccess doesn't return until I kill the first
> psql process.
> Any suggestions? Thanks in advance.
> Chris Goughnour

<snip>

Where do you close the file? That might cause some issues.
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Вложения

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

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Connection gets into state where all queries fail
Следующее
От: Scott Ribe
Дата:
Сообщение: Re: Connection gets into state where all queries fail