Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christopher Ng
OpenLDAP
Commits
3780fa47
Commit
3780fa47
authored
26 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
rdwr.h from orielly examples (with multiple inclusion protection)
parent
cb587e9b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/lthread_rdwr.h
+34
-0
34 additions, 0 deletions
include/lthread_rdwr.h
with
34 additions
and
0 deletions
include/lthread_rdwr.h
0 → 100644
+
34
−
0
View file @
3780fa47
#ifndef _LTHREAD_RDWR_H
#define _LTHREAD_RDWR_H 1
/********************************************************
* An example source module to accompany...
*
* "Using POSIX Threads: Programming with Pthreads"
* by Brad nichols, Dick Buttlar, Jackie Farrell
* O'Reilly & Associates, Inc.
*
********************************************************
*
* Include file for reader/writer locks
*
*/
typedef
struct
rdwr_var
{
int
readers_reading
;
int
writer_writing
;
pthread_mutex_t
mutex
;
pthread_cond_t
lock_free
;
}
pthread_rdwr_t
;
typedef
void
*
pthread_rdwrattr_t
;
#define pthread_rdwrattr_default NULL;
int
pthread_rdwr_init_np
(
pthread_rdwr_t
*
rdwrp
,
pthread_rdwrattr_t
*
attrp
);
int
pthread_rdwr_rlock_np
(
pthread_rdwr_t
*
rdwrp
);
int
pthread_rdwr_runlock_np
(
pthread_rdwr_t
*
rdwrp
);
int
pthread_rdwr_wlock_np
(
pthread_rdwr_t
*
rdwrp
);
int
pthread_rdwr_wunlock_np
(
pthread_rdwr_t
*
rdwrp
);
#endif
/* _LTHREAD_RDWR_H */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment