Skip to content

Commit

Permalink
* Makefile adapted to changes below.
Browse files Browse the repository at this point in the history
* split pythonmain.c in two: most stuff goes to pythonrun.c, in the library.
* new optional built-in threadmodule.c, build upon Sjoerd's thread.{c,h}.
* new module from Sjoerd: mmmodule.c (dynamically loaded).
* new module from Sjoerd: sv (svgen.py, svmodule.c.proto).
* new files thread.{c,h} (from Sjoerd).
* new xxmodule.c (example only).
* myselect.h: bzero -> memset
* select.c: bzero -> memset; removed global variable
  • Loading branch information
gvanrossum committed Aug 4, 1992
1 parent 4fbf798 commit 1984f1e
Show file tree
Hide file tree
Showing 11 changed files with 1,249 additions and 393 deletions.
27 changes: 27 additions & 0 deletions Include/pythread.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#ifndef _THREAD_H_included
#define _THREAD_H_included

#ifdef __STDC__
#define _P(args) args
#else
#define _P(args) ()
#endif

void init_thread _P((void));
int start_new_thread _P((void (*)(void *), void *));
void exit_thread _P((void));

typedef void *type_lock;

type_lock allocate_lock _P((void));
void free_lock _P((type_lock));
int acquire_lock _P((type_lock, int));
#define WAIT_LOCK 1
#define NOWAIT_LOCK 0
void release_lock _P((type_lock));

void exit_prog _P((int));

#undef _P

#endif
27 changes: 27 additions & 0 deletions Include/thread.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#ifndef _THREAD_H_included
#define _THREAD_H_included

#ifdef __STDC__
#define _P(args) args
#else
#define _P(args) ()
#endif

void init_thread _P((void));
int start_new_thread _P((void (*)(void *), void *));
void exit_thread _P((void));

typedef void *type_lock;

type_lock allocate_lock _P((void));
void free_lock _P((type_lock));
int acquire_lock _P((type_lock, int));
#define WAIT_LOCK 1
#define NOWAIT_LOCK 0
void release_lock _P((type_lock));

void exit_prog _P((int));

#undef _P

#endif
16 changes: 9 additions & 7 deletions Modules/config.c.in
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ extern void initpwd();
extern void initgrp();
extern void initmarshal();
extern void initselect();
extern void initsocket();

#ifdef USE_AUDIO
extern void initaudio();
Expand All @@ -148,15 +149,15 @@ extern void initpanel();
#ifdef USE_STDWIN
extern void initstdwin();
#endif
#ifdef USE_SOCKET
extern void initsocket();
#endif
#ifdef USE_JPEG
extern void initjpeg();
#endif
#ifdef USE_CD
extern void initcd();
#endif
#ifdef USE_THREAD
extern void initthread();
#endif

struct {
char *name;
Expand All @@ -173,6 +174,7 @@ struct {
{"grp", initgrp},
{"marshal", initmarshal},
{"select", initselect},
{"socket", initsocket},


/* Optional modules */
Expand Down Expand Up @@ -206,10 +208,6 @@ struct {
{"stdwin", initstdwin},
#endif

#ifdef USE_SOCKET
{"socket", initsocket},
#endif

#ifdef USE_JPEG
{"jpeg", initjpeg},
#endif
Expand All @@ -218,5 +216,9 @@ struct {
{"cd", initcd},
#endif

#ifdef USE_THREAD
{"thread", initthread},
#endif

{0, 0} /* Sentinel */
};
Loading

0 comments on commit 1984f1e

Please sign in to comment.