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
b63a0b1c
Commit
b63a0b1c
authored
26 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
LDAPworldP19: Patch for Next C-Threads
parent
0b0c178c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/lthread.h
+34
-1
34 additions, 1 deletion
include/lthread.h
libraries/liblthread/thread.c
+151
-1
151 additions, 1 deletion
libraries/liblthread/thread.c
with
185 additions
and
2 deletions
include/lthread.h
+
34
−
1
View file @
b63a0b1c
...
...
@@ -3,7 +3,40 @@
#ifndef _LTHREAD_H
#define _LTHREAD_H
#if defined( THREAD_SUNOS4_LWP )
#if defined ( THREAD_NEXT_CTHREADS )
#define _THREAD
#include
<mach/cthreads.h>
typedef
cthread_fn_t
VFP
;
typedef
int
pthread_attr_t
;
typedef
cthread_t
pthread_t
;
/* default attr states */
#define pthread_mutexattr_default NULL
#define pthread_condattr_default NULL
/* thread state - joinable or not */
#define PTHREAD_CREATE_JOINABLE 0
#define PTHREAD_CREATE_DETACHED 1
/* thread scope - who is in scheduling pool */
#define PTHREAD_SCOPE_PROCESS 0
#define PTHREAD_SCOPE_SYSTEM 1
/* mutex attributes and mutex type */
typedef
int
pthread_mutexattr_t
;
typedef
struct
mutex
pthread_mutex_t
;
/* mutex and condition variable scope - process or system */
#define PTHREAD_SHARE_PRIVATE 0
#define PTHREAD_SHARE_PROCESS 1
/* condition variable attributes and condition variable type */
typedef
int
pthread_condattr_t
;
typedef
struct
condition
pthread_cond_t
;
#elif defined( THREAD_SUNOS4_LWP )
/***********************************
* *
* thread definitions for sunos4 *
...
...
This diff is collapsed.
Click to expand it.
libraries/liblthread/thread.c
+
151
−
1
View file @
b63a0b1c
...
...
@@ -2,7 +2,157 @@
#include
<stdio.h>
#include
"lthread.h"
#if defined( THREAD_SUNOS4_LWP )
#if defined( THREAD_NEXT_CTHREADS )
/***********************************************************************
* *
* under NEXTSTEP or OPENSTEP use CThreads *
* lukeh@xedoc.com.au *
* *
***********************************************************************/
int
pthread_attr_init
(
pthread_attr_t
*
attr
)
{
*
attr
=
0
;
return
(
0
);
}
int
pthread_attr_destroy
(
pthread_attr_t
*
attr
)
{
return
(
0
);
}
int
pthread_attr_getdetachstate
(
pthread_attr_t
*
attr
,
int
*
detachstate
)
{
*
detachstate
=
*
attr
;
return
(
0
);
}
int
pthread_attr_setdetachstate
(
pthread_attr_t
*
attr
,
int
detachstate
)
{
*
attr
=
detachstate
;
return
(
0
);
}
/* ARGSUSED */
int
pthread_create
(
pthread_t
*
tid
,
pthread_attr_t
attr
,
VFP
func
,
void
*
arg
)
{
*
tid
=
cthread_fork
(
func
,
arg
);
return
(
*
tid
==
NULL
?
-
1
:
0
);
}
void
pthread_yield
()
{
cthread_yield
();
}
void
pthread_exit
(
any_t
a
)
{
cthread_exit
(
a
);
}
void
pthread_join
(
pthread_t
tid
,
int
*
pStatus
)
{
int
status
;
status
=
(
int
)
cthread_join
(
tid
);
if
(
pStatus
!=
NULL
)
{
*
pStatus
=
status
;
}
}
/* ARGSUSED */
void
pthread_kill
(
pthread_t
tid
,
int
sig
)
{
return
;
}
/* ARGSUSED */
int
pthread_mutex_init
(
pthread_mutex_t
*
mp
,
pthread_mutexattr_t
*
attr
)
{
mutex_init
(
mp
);
mp
->
name
=
NULL
;
return
(
0
);
}
int
pthread_mutex_destroy
(
pthread_mutex_t
*
mp
)
{
mutex_clear
(
mp
);
return
(
0
);
}
int
pthread_mutex_lock
(
pthread_mutex_t
*
mp
)
{
mutex_lock
(
mp
);
return
(
0
);
}
int
pthread_mutex_unlock
(
pthread_mutex_t
*
mp
)
{
mutex_unlock
(
mp
);
return
(
0
);
}
int
pthread_mutex_trylock
(
pthread_mutex_t
*
mp
)
{
return
mutex_try_lock
(
mp
);
}
int
pthread_cond_init
(
pthread_cond_t
*
cv
,
pthread_condattr_t
*
attr
)
{
condition_init
(
cv
);
return
(
0
);
}
int
pthread_cond_destroy
(
pthread_cond_t
*
cv
)
{
condition_clear
(
cv
);
return
(
0
);
}
int
pthread_cond_wait
(
pthread_cond_t
*
cv
,
pthread_mutex_t
*
mp
)
{
condition_wait
(
cv
,
mp
);
return
(
0
);
}
int
pthread_cond_signal
(
pthread_cond_t
*
cv
)
{
condition_signal
(
cv
);
return
(
0
);
}
int
pthread_cond_broadcast
(
pthread_cond_t
*
cv
)
{
condition_broadcast
(
cv
);
return
(
0
);
}
#elif defined( THREAD_SUNOS4_LWP )
/***********************************************************************
* *
...
...
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