PostgreSQL Source Code  git master
sharedfileset.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * sharedfileset.h
4  * Shared temporary file management.
5  *
6  *
7  * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/storage/sharedfileset.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 
15 #ifndef SHAREDFILESET_H
16 #define SHAREDFILESET_H
17 
18 #include "storage/dsm.h"
19 #include "storage/fd.h"
20 #include "storage/fileset.h"
21 #include "storage/spin.h"
22 
23 /*
24  * A set of temporary files that can be shared by multiple backends.
25  */
26 typedef struct SharedFileSet
27 {
29  slock_t mutex; /* mutex protecting the reference count */
30  int refcnt; /* number of attached backends */
32 
33 extern void SharedFileSetInit(SharedFileSet *fileset, dsm_segment *seg);
34 extern void SharedFileSetAttach(SharedFileSet *fileset, dsm_segment *seg);
35 extern void SharedFileSetDeleteAll(SharedFileSet *fileset);
36 
37 #endif
int slock_t
Definition: s_lock.h:958
struct SharedFileSet SharedFileSet
void SharedFileSetInit(SharedFileSet *fileset, dsm_segment *seg)
Definition: sharedfileset.c:44
void SharedFileSetAttach(SharedFileSet *fileset, dsm_segment *seg)
Definition: sharedfileset.c:62
void SharedFileSetDeleteAll(SharedFileSet *fileset)
Definition: sharedfileset.c:89