Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
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
Container registry
Model registry
Operate
Environments
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
pikelang
pike
Commits
b2a0fbcd
Commit
b2a0fbcd
authored
28 years ago
by
Henrik (Grubba) Grubbström
Browse files
Options
Downloads
Patches
Plain Diff
Added some sproc support.
Rev: src/threads.c:1.15 Rev: src/threads.h:1.10
parent
e5726e13
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
src/threads.c
+8
-1
8 additions, 1 deletion
src/threads.c
src/threads.h
+17
-5
17 additions, 5 deletions
src/threads.h
with
25 additions
and
6 deletions
src/threads.c
+
8
−
1
View file @
b2a0fbcd
#include
"global.h"
RCSID
(
"$Id: threads.c,v 1.1
4
1997/0
1/26 22:49:14 per
Exp $"
);
RCSID
(
"$Id: threads.c,v 1.1
5
1997/0
2/06 03:53:48 grubba
Exp $"
);
int
num_threads
=
1
;
int
threads_disabled
=
0
;
...
...
@@ -11,6 +11,7 @@ int threads_disabled = 0;
#include
"macros.h"
#include
"callback.h"
struct
object
*
thread_id
;
static
struct
callback
*
threads_evaluator_callback
=
0
;
...
...
@@ -99,7 +100,9 @@ void f_thread_create(INT32 args)
arg
=
ALLOC_STRUCT
(
thread_starter
);
arg
->
args
=
aggregate_array
(
args
);
arg
->
id
=
clone
(
thread_id_prog
,
0
);
tmp
=
th_create
(
&
dummy
,
new_thread_func
,
arg
);
if
(
!
tmp
)
{
num_threads
++
;
...
...
@@ -142,6 +145,10 @@ void f_this_thread(INT32 args)
void
th_init
()
{
#ifdef SGI_SPROC_THREADS
#error
/* Need to specify a filename */
us_cookie
=
usinit
(
""
);
#endif
/* SGI_SPROC_THREADS */
mt_lock
(
&
interpreter_lock
);
#ifdef POSIX_THREADS
pthread_attr_init
(
&
pattr
);
...
...
This diff is collapsed.
Click to expand it.
src/threads.h
+
17
−
5
View file @
b2a0fbcd
...
...
@@ -7,24 +7,36 @@
#ifdef _REENTRANT
/*
* Decide which type of threads to use
*
* UNIX_THREADS : Unix international threads
* POSIX_THREADS : POSIX standard threads
* SGI_SPROC_THREADS : SGI sproc() based threads
*/
#ifdef _UNIX_THREADS
#ifdef HAVE_THREAD_H
#define UNIX_THREADS
#include
<thread.h>
#undef HAVE_PTHREAD_H
#undef HAVE_THREAD_H
#endif
#endif
/* _UNIX_THREADS */
#ifdef _MIT_POSIX_THREADS
#ifdef HAVE_PTHREAD_H
#define POSIX_THREADS
#include
<pthread.h>
#undef HAVE_PTHREAD_H
#endif
#endif
/* _MIT_POSIX_THREADS */
#ifdef SPROC_THREADS
#ifdef
_SGI_
SPROC_THREADS
/* Not supported yet */
#undef SPROC_THREADS
#undef
SGI_
SPROC_THREADS
#undef HAVE_SPROC
#endif
/* SPROC_THREADS */
#endif
/*
_SGI_
SPROC_THREADS */
extern
int
num_threads
;
...
...
@@ -108,7 +120,7 @@ extern struct object *thread_id;
#endif
/* UNIX_THREADS */
#ifdef SPROC_THREADS
#ifdef
SGI_
SPROC_THREADS
/*
* Not fully supported yet
...
...
@@ -133,7 +145,7 @@ extern struct object *thread_id;
* No cond_vars yet
*/
#endif
/* SPROC_THREADS */
#endif
/*
SGI_
SPROC_THREADS */
extern
MUTEX_T
interpreter_lock
;
...
...
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