diff options
author | Bruce Momjian <bruce@momjian.us> | 2006-10-04 00:30:14 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2006-10-04 00:30:14 +0000 |
commit | f99a569a2ee3763b4ae174e81250c95ca0fdcbb6 (patch) | |
tree | 76e6371fe8b347c73d7020c0bc54b9fba519dc10 /src/backend/port/win32_sema.c | |
parent | 451e419e9852cdf9d7e7cefc09d5355abb3405e9 (diff) | |
download | postgresql-f99a569a2ee3763b4ae174e81250c95ca0fdcbb6.tar.gz postgresql-f99a569a2ee3763b4ae174e81250c95ca0fdcbb6.zip |
pgindent run for 8.2.
Diffstat (limited to 'src/backend/port/win32_sema.c')
-rw-r--r-- | src/backend/port/win32_sema.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/backend/port/win32_sema.c b/src/backend/port/win32_sema.c index 3af18df634f..0d99a9a0f5c 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.2 2006/07/16 02:44:01 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/port/win32_sema.c,v 1.3 2006/10/04 00:29:56 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -32,9 +32,10 @@ static void ReleaseSemaphores(int code, Datum arg); * so the semaphores are automatically freed when the last referencing * process exits. */ -void PGReserveSemaphores(int maxSemas, int port) +void +PGReserveSemaphores(int maxSemas, int port) { - mySemSet = (HANDLE *)malloc(maxSemas * sizeof(HANDLE)); + mySemSet = (HANDLE *) malloc(maxSemas * sizeof(HANDLE)); if (mySemSet == NULL) elog(PANIC, "out of memory"); numSems = 0; @@ -63,7 +64,8 @@ ReleaseSemaphores(int code, Datum arg) * * Initialize a PGSemaphore structure to represent a sema with count 1 */ -void PGSemaphoreCreate(PGSemaphore sema) +void +PGSemaphoreCreate(PGSemaphore sema) { HANDLE cur_handle; SECURITY_ATTRIBUTES sec_attrs; @@ -89,7 +91,7 @@ void PGSemaphoreCreate(PGSemaphore sema) } else ereport(PANIC, - (errmsg("could not create semaphore: error code %d", (int)GetLastError()))); + (errmsg("could not create semaphore: error code %d", (int) GetLastError()))); } /* @@ -97,7 +99,8 @@ void PGSemaphoreCreate(PGSemaphore sema) * * Reset a previously-initialized PGSemaphore to have count 0 */ -void PGSemaphoreReset(PGSemaphore sema) +void +PGSemaphoreReset(PGSemaphore sema) { /* * There's no direct API for this in Win32, so we have to ratchet the @@ -112,7 +115,8 @@ void PGSemaphoreReset(PGSemaphore sema) * Lock a semaphore (decrement count), blocking if count would be < 0. * Serve the interrupt if interruptOK is true. */ -void PGSemaphoreLock(PGSemaphore sema, bool interruptOK) +void +PGSemaphoreLock(PGSemaphore sema, bool interruptOK) { DWORD ret; HANDLE wh[2]; @@ -156,7 +160,8 @@ void PGSemaphoreLock(PGSemaphore sema, bool interruptOK) * * Unlock a semaphore (increment count) */ -void PGSemaphoreUnlock(PGSemaphore sema) +void +PGSemaphoreUnlock(PGSemaphore sema) { if (!ReleaseSemaphore(*sema, 1, NULL)) ereport(FATAL, @@ -168,7 +173,8 @@ void PGSemaphoreUnlock(PGSemaphore sema) * * Lock a semaphore only if able to do so without blocking */ -bool PGSemaphoreTryLock(PGSemaphore sema) +bool +PGSemaphoreTryLock(PGSemaphore sema) { DWORD ret; @@ -189,7 +195,7 @@ bool PGSemaphoreTryLock(PGSemaphore sema) /* Otherwise we are in trouble */ ereport(FATAL, (errmsg("could not try-lock semaphore: error code %d", (int) GetLastError()))); - + /* keep compiler quiet */ return false; } |