From 3f92fd65244db0cd8fef46e88ef79c6acc3c84dd Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Tue, 24 Apr 2007 12:25:23 +0000 Subject: [PATCH] Set maximum semaphore count to 32767 instead of 1. Fixes errorcode 298 when unlocking a semaphore more than once. Per report from Marcin Waldowski. --- src/backend/port/win32_sema.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/port/win32_sema.c b/src/backend/port/win32_sema.c index 0d99a9a0f5..a2acaf2d60 100644 --- a/src/backend/port/win32_sema.c +++ b/src/backend/port/win32_sema.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/port/win32_sema.c,v 1.3 2006/10/04 00:29:56 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/port/win32_sema.c,v 1.3.2.1 2007/04/24 12:25:23 mha Exp $ * *------------------------------------------------------------------------- */ @@ -82,7 +82,7 @@ PGSemaphoreCreate(PGSemaphore sema) sec_attrs.bInheritHandle = TRUE; /* We don't need a named semaphore */ - cur_handle = CreateSemaphore(&sec_attrs, 1, 1, NULL); + cur_handle = CreateSemaphore(&sec_attrs, 1, 32767, NULL); if (cur_handle) { /* Successfully done */