PostgreSQL Source Code
git master
test_shm_mq.h
Go to the documentation of this file.
1
/*--------------------------------------------------------------------------
2
*
3
* test_shm_mq.h
4
* Definitions for shared memory message queues
5
*
6
* Copyright (c) 2013-2024, PostgreSQL Global Development Group
7
*
8
* IDENTIFICATION
9
* src/test/modules/test_shm_mq/test_shm_mq.h
10
*
11
* -------------------------------------------------------------------------
12
*/
13
14
#ifndef TEST_SHM_MQ_H
15
#define TEST_SHM_MQ_H
16
17
#include "
storage/dsm.h
"
18
#include "
storage/shm_mq.h
"
19
#include "
storage/spin.h
"
20
21
/* Identifier for shared memory segments used by this extension. */
22
#define PG_TEST_SHM_MQ_MAGIC 0x79fb2447
23
24
/*
25
* This structure is stored in the dynamic shared memory segment. We use
26
* it to determine whether all workers started up OK and successfully
27
* attached to their respective shared message queues.
28
*/
29
typedef
struct
30
{
31
slock_t
mutex
;
32
int
workers_total
;
33
int
workers_attached
;
34
int
workers_ready
;
35
}
test_shm_mq_header
;
36
37
/* Set up dynamic shared memory and background workers for test run. */
38
extern
void
test_shm_mq_setup
(int64 queue_size,
int32
nworkers,
39
dsm_segment
**segp,
shm_mq_handle
**
output
,
40
shm_mq_handle
**
input
);
41
42
/* Main entrypoint for a worker. */
43
extern
PGDLLEXPORT
void
test_shm_mq_main
(
Datum
)
pg_attribute_noreturn
();
44
45
#endif
int32
signed int int32
Definition:
c.h:497
pg_attribute_noreturn
#define pg_attribute_noreturn()
Definition:
c.h:220
PGDLLEXPORT
#define PGDLLEXPORT
Definition:
c.h:1334
dsm.h
input
FILE * input
output
FILE * output
Definition:
pg_test_timing.c:182
Datum
uintptr_t Datum
Definition:
postgres.h:64
shm_mq.h
spin.h
dsm_segment
Definition:
dsm.c:67
shm_mq_handle
Definition:
shm_mq.c:138
test_shm_mq_header
Definition:
test_shm_mq.h:30
test_shm_mq_header::workers_total
int workers_total
Definition:
test_shm_mq.h:32
test_shm_mq_header::mutex
slock_t mutex
Definition:
test_shm_mq.h:31
test_shm_mq_header::workers_attached
int workers_attached
Definition:
test_shm_mq.h:33
test_shm_mq_header::workers_ready
int workers_ready
Definition:
test_shm_mq.h:34
test_shm_mq_main
PGDLLEXPORT void test_shm_mq_main(Datum) pg_attribute_noreturn()
Definition:
worker.c:47
test_shm_mq_setup
void test_shm_mq_setup(int64 queue_size, int32 nworkers, dsm_segment **segp, shm_mq_handle **output, shm_mq_handle **input)
Definition:
setup.c:51
src
test
modules
test_shm_mq
test_shm_mq.h
Generated on Thu Oct 10 2024 00:13:26 for PostgreSQL Source Code by
1.9.1