Set maximum semaphore count to 32767 instead of 1. Fixes
authorMagnus Hagander <magnus@hagander.net>
Tue, 24 Apr 2007 12:25:18 +0000 (12:25 +0000)
committerMagnus Hagander <magnus@hagander.net>
Tue, 24 Apr 2007 12:25:18 +0000 (12:25 +0000)
errorcode 298 when unlocking a semaphore more than once.

Per report from Marcin Waldowski.

src/backend/port/win32_sema.c

index aa9b4942a533f3dc17f105a087d1eae367f85954..f65858a6a20a19182467d311dfc7a5a5e589a84f 100644 (file)
@@ -6,7 +6,7 @@
  * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/src/backend/port/win32_sema.c,v 1.4 2007/01/05 22:19:35 momjian Exp $
+ *   $PostgreSQL: pgsql/src/backend/port/win32_sema.c,v 1.5 2007/04/24 12:25:18 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 */