From: Magnus Hagander Date: Tue, 24 Apr 2007 12:25:23 +0000 (+0000) Subject: Set maximum semaphore count to 32767 instead of 1. Fixes X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=807c63ca1b7db82ca7656f3ec469926729ce3697;p=users%2Fbernd%2Fpostgres.git Set maximum semaphore count to 32767 instead of 1. Fixes errorcode 298 when unlocking a semaphore more than once. Per report from Marcin Waldowski. --- diff --git a/src/backend/port/win32_sema.c b/src/backend/port/win32_sema.c index 9690fbf713..4129850e4a 100644 --- a/src/backend/port/win32_sema.c +++ b/src/backend/port/win32_sema.c @@ -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 */