summaryrefslogtreecommitdiffstats
path: root/Modules/timemodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-08-04 12:41:02 (GMT)
committerGuido van Rossum <guido@python.org>1992-08-04 12:41:02 (GMT)
commit1984f1e1c6306d4e8073c28d2395638f80ea509b (patch)
tree4366039e7665e689aef04549c3e3d73f99bdab32 /Modules/timemodule.c
parent4fbf798f866b10ee50cc91a394d19c0d4b2f79ab (diff)
downloadcpython-1984f1e1c6306d4e8073c28d2395638f80ea509b.zip
cpython-1984f1e1c6306d4e8073c28d2395638f80ea509b.tar.gz
cpython-1984f1e1c6306d4e8073c28d2395638f80ea509b.tar.bz2
* Makefile adapted to changes below.
* 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
Diffstat (limited to 'Modules/timemodule.c')
-rw-r--r--Modules/timemodule.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index 4a921f0..5a278a9bd 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -104,11 +104,14 @@ time_sleep(self, args)
object *self;
object *args;
{
+ void *save, *save_thread(), restore_thread();
int secs;
SIGTYPE (*sigsave)() = 0; /* Initialized to shut lint up */
if (!getintarg(args, &secs))
return NULL;
+ save = save_thread();
if (setjmp(sleep_intr)) {
+ restore_thread(save);
signal(SIGINT, sigsave);
err_set(KeyboardInterrupt);
return NULL;
@@ -117,6 +120,7 @@ time_sleep(self, args)
if (sigsave != (SIGTYPE (*)()) SIG_IGN)
signal(SIGINT, sleep_catcher);
sleep(secs);
+ restore_thread(save);
signal(SIGINT, sigsave);
INCREF(None);
return None;
@@ -147,11 +151,14 @@ time_millisleep(self, args)
object *self;
object *args;
{
+ void *save, *save_thread(), restore_thread();
long msecs;
SIGTYPE (*sigsave)();
if (!getlongarg(args, &msecs))
return NULL;
+ save = save_thread();
if (setjmp(sleep_intr)) {
+ restore_thread(save);
signal(SIGINT, sigsave);
err_set(KeyboardInterrupt);
return NULL;
@@ -160,6 +167,7 @@ time_millisleep(self, args)
if (sigsave != (SIGTYPE (*)()) SIG_IGN)
signal(SIGINT, sleep_catcher);
millisleep(msecs);
+ restore_thread(save);
signal(SIGINT, sigsave);
INCREF(None);
return None;