tlds
Transactional Operations for Linked Data Structures
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
ptst.h
Go to the documentation of this file.
1
/******************************************************************************
2
* ptst.h
3
*
4
* Per-thread state management.
5
*
6
* Copyright (c) 2002-2003, K A Fraser
7
*/
8
9
#ifndef __PTST_H__
10
#define __PTST_H__
11
12
typedef
struct
ptst_st
ptst_t
;
13
14
#include "
gc.h
"
15
#include "
random.h
"
16
17
struct
ptst_st
18
{
19
/* Thread id */
20
unsigned
int
id
;
21
22
/* State management */
23
ptst_t
*
next
;
24
unsigned
int
count
;
25
/* Utility structures */
26
gc_t
*
gc
;
27
rand_t
rand
;
28
};
29
30
extern
pthread_key_t
ptst_key
;
31
32
/*
33
* Enter/leave a critical region. A thread gets a state handle for
34
* use during critical regions.
35
*/
36
ptst_t
*
fr_critical_enter
(
void
);
37
#define fr_critical_exit(_p) fr_gc_exit(_p)
38
39
/* Iterators */
40
extern
ptst_t
*
ptst_list
;
41
#define ptst_first() (ptst_list)
42
#define ptst_next(_p) ((_p)->next)
43
44
/* Called once at start-of-day for entire application. */
45
void
fr_init_ptst_subsystem
(
void
);
46
47
#endif
/* __PTST_H__ */
ptst_st::rand
rand_t rand
Definition:
ptst.h:27
ptst_st
Definition:
ptst.h:17
ptst_st::next
ptst_t * next
Definition:
ptst.h:23
ptst_st::gc
gc_t * gc
Definition:
ptst.h:26
random.h
ptst_key
pthread_key_t ptst_key
Definition:
ptst.c:32
ptst_list
ptst_t * ptst_list
Definition:
ptst.c:33
gc.h
ptst_st::count
unsigned int count
Definition:
ptst.h:24
fr_init_ptst_subsystem
void fr_init_ptst_subsystem(void)
Definition:
ptst.c:86
gc_st
Definition:
gc.c:133
unsigned long
fr_critical_enter
ptst_t * fr_critical_enter(void)
Definition:
ptst.c:37
ptst_st::id
unsigned int id
Definition:
ptst.h:20
common
fraser
ptst.h
Generated on Thu Sep 8 2016 13:28:38 for tlds by
1.8.6