Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 462bf7f

Browse files
committed
win compat
1 parent d34c540 commit 462bf7f

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

src/bgwpool.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ BgwPoolMainLoop(BgwPool* pool)
150150
/* Ignore cancel that arrived before we started current command */
151151
QueryCancelPending = false;
152152

153-
pool->executor(work, size, &ctx);
153+
MtmExecutor(work, size, &ctx);
154154
pfree(work);
155155

156156
SpinLockAcquire(&pool->lock);
@@ -168,7 +168,7 @@ BgwPoolMainLoop(BgwPool* pool)
168168
// XXX: this is called during _PG_init because we need to allocate queue.
169169
// Better to use DSM, so that can be done dynamically.
170170
void
171-
BgwPoolInit(BgwPool* pool, BgwPoolExecutor executor, size_t queueSize, size_t nWorkers)
171+
BgwPoolInit(BgwPool* pool, size_t queueSize, size_t nWorkers)
172172
{
173173
MtmPool = pool;
174174

@@ -177,7 +177,6 @@ BgwPoolInit(BgwPool* pool, BgwPoolExecutor executor, size_t queueSize, size_t nW
177177
if (pool->queue == NULL) {
178178
elog(PANIC, "Failed to allocate memory for background workers pool: %zd bytes requested", queueSize);
179179
}
180-
pool->executor = executor;
181180
pool->available = PGSemaphoreCreate();
182181
pool->overflow = PGSemaphoreCreate();
183182
PGSemaphoreReset(pool->available);
@@ -282,7 +281,7 @@ BgwPoolExecute(BgwPool* pool, void* work, int size, MtmReceiverContext *ctx)
282281
* Size of work is larger than size of shared buffer:
283282
* run it immediately
284283
*/
285-
pool->executor(work, size, ctx);
284+
MtmExecutor(work, size, ctx);
286285
return;
287286
}
288287

src/include/bgwpool.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
#include "receiver.h"
1111

12-
typedef void(*BgwPoolExecutor)(void* work, size_t size, MtmReceiverContext *ctx);
13-
1412
typedef long timestamp_t;
1513

1614

@@ -24,7 +22,6 @@ extern timestamp_t MtmGetCurrentTime(void); /* adjusted current system time */
2422

2523
typedef struct
2624
{
27-
BgwPoolExecutor executor;
2825
volatile slock_t lock;
2926
PGSemaphore available;
3027
PGSemaphore overflow;
@@ -50,7 +47,7 @@ typedef BgwPool*(*BgwPoolConstructor)(void);
5047

5148
extern void BgwPoolStart(BgwPool* pool, char *poolName, Oid db_id, Oid user_id);
5249

53-
extern void BgwPoolInit(BgwPool* pool, BgwPoolExecutor executor, size_t queueSize, size_t nWorkers);
50+
extern void BgwPoolInit(BgwPool* pool, size_t queueSize, size_t nWorkers);
5451

5552
extern void BgwPoolExecute(BgwPool* pool, void* work, int size, MtmReceiverContext *ctx);
5653

src/multimaster.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ MtmSharedShmemStartup()
285285
Mtm->peers[i].dmq_dest_id = -1;
286286

287287
// XXX: change to dsa and make it per-receiver
288-
BgwPoolInit(&Mtm->pools[i], MtmExecutor, MtmQueueSize, 0);
288+
BgwPoolInit(&Mtm->pools[i], MtmQueueSize, 0);
289289
}
290290
}
291291

0 commit comments

Comments
 (0)