Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Main
Synchronet
Commits
a63131b3
Commit
a63131b3
authored
22 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Whoops, left out the pthread_private.h stuff... this would not have
compiled for anyone by me. *Blush*
parent
29044591
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/xpdev/sem.c
+0
-1
0 additions, 1 deletion
src/xpdev/sem.c
src/xpdev/sem.h
+48
-0
48 additions, 0 deletions
src/xpdev/sem.h
with
48 additions
and
1 deletion
src/xpdev/sem.c
+
0
−
1
View file @
a63131b3
...
...
@@ -34,7 +34,6 @@
#include
<errno.h>
#include
"sem.h"
#include
<pthread.h>
#include
"pthread_private.h"
int
sem_init
(
sem_t
*
sem
,
int
pshared
,
unsigned
int
value
)
...
...
This diff is collapsed.
Click to expand it.
src/xpdev/sem.h
+
48
−
0
View file @
a63131b3
...
...
@@ -69,4 +69,52 @@ int sem_getvalue __P((sem_t *, int *));
__END_DECLS
#endif
/* KERNEL */
/*
* $Id$
*/
/* Begin thread_private.h kluge */
/*
* These come out of (or should go into) thread_private.h - rather than have
* to copy (or symlink) the files from the source tree these definitions are
* inlined here. Obviously these go away when this module is part of libc.
*/
struct
sem
{
#define SEM_MAGIC ((u_int32_t) 0x09fa4012)
u_int32_t
magic
;
pthread_mutex_t
lock
;
pthread_cond_t
gtzero
;
u_int32_t
count
;
u_int32_t
nwaiters
;
};
extern
pthread_once_t
_thread_init_once
;
extern
int
_threads_initialized
;
extern
void
_thread_init
__P
((
void
));
#define THREAD_INIT() \
(void) pthread_once(&_thread_init_once, _thread_init)
#define THREAD_SAFE() \
(_threads_initialized != 0)
#define _SEM_CHECK_VALIDITY(sem) \
if ((*(sem))->magic != SEM_MAGIC) { \
errno = EINVAL; \
retval = -1; \
goto RETURN; \
}
struct
pthread_rwlockattr
{
int
pshared
;
};
struct
pthread_rwlock
{
pthread_mutex_t
lock
;
/* monitor lock */
int
state
;
/* 0 = idle >0 = # of readers -1 = writer */
pthread_cond_t
read_signal
;
pthread_cond_t
write_signal
;
int
blocked_writers
;
};
/* End thread_private.h kluge */
#endif
/* _SEMAPHORE_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