Set maximum semaphore count to 32767 instead of 1. Fixes
authorMagnus Hagander <magnus@hagander.net>
Tue, 24 Apr 2007 12:25:23 +0000 (12:25 +0000)
committerMagnus Hagander <magnus@hagander.net>
Tue, 24 Apr 2007 12:25:23 +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 ae9fc5318f8b654a0d80114a7f11f06aecebde55..a31c4073eb3d559d68519f95d58a04ade17293a5 100644 (file)
@@ -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 */