Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
cd9999a9
Commit
cd9999a9
authored
Feb 10, 1999
by
Bob Halley
Browse files
add comments, move color to avoid locking problem
parent
fd350b6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/dns/include/dns/rbt.h
View file @
cd9999a9
...
...
@@ -31,17 +31,29 @@
typedef
struct
dns_rbt
dns_rbt_t
;
/* These should add up to 3
0
*/
/* These should add up to 3
1
*/
#define DNS_RBT_LOCKLENGTH 1
0
#define DNS_RBT_LOCKLENGTH 1
1
#define DNS_RBT_REFLENGTH 20
typedef
struct
dns_rbt_node
{
struct
dns_rbt_node
*
left
;
struct
dns_rbt_node
*
right
;
struct
dns_rbt_node
*
down
;
/*
* We'd like to find a better place for the single bit of color
* information. We can't pack it into the bitfield below, however,
* because it's not covered by the node lock, and changing a single
* bit in a bitfield is going to require a read-modify-write of a
* word. This read-modify-write would include bits covered by a
* lock we don't hold, and thus violate locking.
*/
unsigned
int
color
;
/*
* These values are used in the RBT DB implementation. The appropriate
* node lock must be held before accessing them.
*/
void
*
data
;
unsigned
int
color
:
1
;
unsigned
int
dirty
:
1
;
unsigned
int
locknum
:
DNS_RBT_LOCKLENGTH
;
unsigned
int
references
:
DNS_RBT_REFLENGTH
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment