]> git.pond.sub.org Git - empserver/commitdiff
(lwpReschedule): Remove code permitting SIGALRM to be catched safely,
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 6 Jun 2006 20:57:03 +0000 (20:57 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 6 Jun 2006 20:57:03 +0000 (20:57 +0000)
because there's no handler for it.
(LCOUNT, oldmask): Remove.
(lwpEntryPoint): Don't initialize oldmask.  Should have been done in
lwpInitSystem() anyway.

src/lib/lwp/lwp.c
src/lib/lwp/lwpint.h

index 5234d2ec12b4c1746255e1f1590b2ee5e2fb814e..c575d9ec0b913561fcc49809333b2864a6049ca7 100644 (file)
@@ -35,7 +35,6 @@
 #include <config.h>
 
 #include <stdio.h>
-#include <signal.h>
 #include <stdlib.h>
 #include <string.h>
 #include "lwp.h"
@@ -49,8 +48,6 @@ char **LwpContextPtr;
 int LwpMaxpri = 0;             /* maximum priority so far */
 int LwpStackGrowsDown;
 
-static sigset_t oldmask;
-
 static void lwpStackCheckInit(struct lwpProc *newp);
 static void lwpStackCheck(struct lwpProc *newp);
 static void lwpStackCheckUsed(struct lwpProc *newp);
@@ -71,21 +68,12 @@ growsdown(void *x)
 void
 lwpReschedule(void)
 {
-    static int lcount = LCOUNT;
     static struct lwpProc *nextp;
     static int i;
-    static sigset_t tmask;
 
     if (LwpCurrent && (LwpCurrent->flags & LWP_STACKCHECK)) {
        lwpStackCheck(LwpCurrent);
     }
-    if (!--lcount) {
-       int p = lwpSetPriority(LWP_MAX_PRIO - 1);
-       lcount = LCOUNT;
-       sigprocmask(SIG_SETMASK, &oldmask, &tmask);
-       sigprocmask(SIG_SETMASK, &tmask, &oldmask);
-       LwpCurrent->pri = p;
-    }
 
     /* destroy dead threads */
     lwpStatus(LwpCurrent, "Cleaning dead queue");
@@ -132,13 +120,7 @@ lwpReschedule(void)
 void
 lwpEntryPoint(void)
 {
-    sigset_t set;
-
-    sigemptyset(&set);
-    sigaddset(&set, SIGALRM);
-    sigprocmask(SIG_SETMASK, &set, &oldmask);
     *LwpContextPtr = LwpCurrent->ud;
-
     lwpStatus(LwpCurrent, "starting at entry point");
     (*LwpCurrent->entry)(LwpCurrent->ud);
     lwpExit();
index e8895ca6808a19ca547cb46ff16cba613a331253..e686660bb95267161ab2fb27422db21e99f06e28 100644 (file)
 #include <setjmp.h>
 #endif /* !UCONTEXT */
 
-/* `liveness' counter: check signals every `n' visits to the scheduler */
-/* note: the lower this value, the more responsive the system but the */
-/* more inefficient the context switch time */
-#define LCOUNT -1
-
 /* process control block.  do *not* change the position of context */
 struct lwpProc {
 #ifdef UCONTEXT