Skip to content
Snippets Groups Projects
Commit b2a0fbcd authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

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
#include "global.h"
RCSID("$Id: threads.c,v 1.14 1997/01/26 22:49:14 per Exp $");
RCSID("$Id: threads.c,v 1.15 1997/02/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);
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment