Set maximum semaphore count to 32767 instead of 1. Fixes
authorMagnus Hagander <[email protected]>
Tue, 24 Apr 2007 12:25:23 +0000 (12:25 +0000)
committerMagnus Hagander <[email protected]>
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 9690fbf7130979cb92644f13ca498990b1100200..4129850e4aa05a705d858d65e58e3f9237ee68af 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 */