Changeset: f4dc46d3dfc4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f4dc46d3dfc4
Modified Files:
        clients/Tests/MAL-signatures.stable.out
        clients/Tests/MAL-signatures.stable.out.int128
        clients/Tests/exports.stable.out
        gdk/gdk_system.c
        monetdb5/modules/kernel/alarm.c
        monetdb5/modules/kernel/alarm.mal
Branch: Apr2019
Log Message:

Remove (unused) alarm references.
(grafted from d7555b8ffcba46ce34f1c0633ab3b7054569884b)


diffs (236 lines):

diff --git a/clients/Tests/MAL-signatures.stable.out 
b/clients/Tests/MAL-signatures.stable.out
--- a/clients/Tests/MAL-signatures.stable.out
+++ b/clients/Tests/MAL-signatures.stable.out
@@ -513,9 +513,7 @@ Ready.
 [ "aggr",      "variancep",    "command aggr.variancep(b:bat[:sht], 
g:bat[:oid], e:bat[:any_1]):bat[:dbl] ",   "AGGRvariancep3_dbl;",  "Grouped 
tail variance (population/biased) on sht"      ]
 [ "aggr",      "variancep",    "command aggr.variancep(b:bat[:any_2]):dbl ",   
"ALGvariancep;",        "Gives the variance of all tail values" ]
 [ "alarm",     "ctime",        "unsafe command alarm.ctime():str ",    
"ALARMctime;",  "Return the current time as a C-time string."   ]
-[ "alarm",     "epilogue",     "command alarm.epilogue():void ",       
"ALARMepilogue;",       "Finalize alarm module."        ]
 [ "alarm",     "epoch",        "unsafe command alarm.epoch():int ",    
"ALARMepoch;",  "Return the current time as UNIX epoch."        ]
-[ "alarm",     "prelude",      "command alarm.prelude():void ",        
"ALARMprelude;",        "Initialize alarm module."      ]
 [ "alarm",     "sleep",        "unsafe command alarm.sleep(secs:int):void ",   
"ALARMsleep;",  "Sleep a few seconds"   ]
 [ "alarm",     "time", "unsafe command alarm.time():int ",     "ALARMtime;",   
"Return time in milliseconds."  ]
 [ "alarm",     "usec", "unsafe command alarm.usec():lng ",     "ALARMusec;",   
"Return time in microseconds."  ]
diff --git a/clients/Tests/MAL-signatures.stable.out.int128 
b/clients/Tests/MAL-signatures.stable.out.int128
--- a/clients/Tests/MAL-signatures.stable.out.int128
+++ b/clients/Tests/MAL-signatures.stable.out.int128
@@ -617,9 +617,7 @@ Ready.
 [ "aggr",      "variancep",    "command aggr.variancep(b:bat[:sht], 
g:bat[:oid], e:bat[:any_1]):bat[:dbl] ",   "AGGRvariancep3_dbl;",  "Grouped 
tail variance (population/biased) on sht"      ]
 [ "aggr",      "variancep",    "command aggr.variancep(b:bat[:any_2]):dbl ",   
"ALGvariancep;",        "Gives the variance of all tail values" ]
 [ "alarm",     "ctime",        "unsafe command alarm.ctime():str ",    
"ALARMctime;",  "Return the current time as a C-time string."   ]
-[ "alarm",     "epilogue",     "command alarm.epilogue():void ",       
"ALARMepilogue;",       "Finalize alarm module."        ]
 [ "alarm",     "epoch",        "unsafe command alarm.epoch():int ",    
"ALARMepoch;",  "Return the current time as UNIX epoch."        ]
-[ "alarm",     "prelude",      "command alarm.prelude():void ",        
"ALARMprelude;",        "Initialize alarm module."      ]
 [ "alarm",     "sleep",        "unsafe command alarm.sleep(secs:int):void ",   
"ALARMsleep;",  "Sleep a few seconds"   ]
 [ "alarm",     "time", "unsafe command alarm.time():int ",     "ALARMtime;",   
"Return time in milliseconds."  ]
 [ "alarm",     "usec", "unsafe command alarm.usec():lng ",     "ALARMusec;",   
"Return time in microseconds."  ]
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -690,13 +690,9 @@ str AGGRsum3_sht(bat *retval, const bat 
 str AGGRvariance3_dbl(bat *retval, const bat *bid, const bat *gid, const bat 
*eid);
 str AGGRvariancep3_dbl(bat *retval, const bat *bid, const bat *gid, const bat 
*eid);
 str ALARMctime(str *res);
-str ALARMepilogue(void *ret);
 str ALARMepoch(int *res);
-str ALARMprelude(void *ret);
-str ALARMsetalarm(void *res, int *secs, str *action);
 str ALARMsleep(void *res, int *secs);
 str ALARMtime(int *res);
-str ALARMtimers(bat *res, bat *actions);
 str ALARMusec(lng *ret);
 str ALGbandjoin(bat *r1, bat *r2, const bat *lid, const bat *rid, const bat 
*slid, const bat *srid, const void *low, const void *high, const bit *li, const 
bit *hi, const lng *estimate);
 str ALGcard(lng *result, const bat *bid);
diff --git a/gdk/gdk_system.c b/gdk/gdk_system.c
--- a/gdk/gdk_system.c
+++ b/gdk/gdk_system.c
@@ -536,7 +536,6 @@ MT_thread_sigmask(sigset_t *new_mask, si
 {
        /* do not check for errors! */
        sigdelset(new_mask, SIGQUIT);
-       sigdelset(new_mask, SIGALRM);
        sigdelset(new_mask, SIGPROF);
        pthread_sigmask(SIG_SETMASK, new_mask, orig_mask);
 }
diff --git a/monetdb5/modules/kernel/alarm.c b/monetdb5/modules/kernel/alarm.c
--- a/monetdb5/modules/kernel/alarm.c
+++ b/monetdb5/modules/kernel/alarm.c
@@ -25,106 +25,17 @@
 #include <signal.h>
 #include <time.h>
 
-mal_export str ALARMprelude(void *ret);
-mal_export str ALARMepilogue(void *ret);
 mal_export str ALARMusec(lng *ret);
 mal_export str ALARMsleep(void *res, int *secs);
-mal_export str ALARMsetalarm(void *res, int *secs, str *action);
-mal_export str ALARMtimers(bat *res, bat *actions);
 mal_export str ALARMctime(str *res);
 mal_export str ALARMepoch(int *res);
 mal_export str ALARMtime(int *res);
 
-#define MAXtimer                200
-
-typedef struct {
-       str action;             /* action (as a string) */
-       MT_Sema sema;           /* barrier */
-       time_t alarm_time;      /* time when the alarm goes off */
-} monet_timer_t;
-
-static monet_timer_t timer[MAXtimer];
-static int timerTop = 0;
-
-/*
- * Once a timer interrupt occurs, we should inspect the timer queue and
- * emit a notify signal.
- */
-#ifdef SIGALRM
-/* HACK to pacify compiler */
-#if (defined(__INTEL_COMPILER) && (SIZEOF_VOID_P > SIZEOF_INT))
-#undef  SIG_ERR                        /*((__sighandler_t)-1 ) */
-#define SIG_ERR   ((__sighandler_t)-1L)
-#endif
-static void
-CLKsignal(int nr)
-{
-       /* int restype; */
-       int k = timerTop;
-       int t;
-
-       (void) nr;
-
-       if (signal(SIGALRM, CLKsignal) == SIG_ERR) 
-               GDKsyserror("CLKsignal: call failed\n");
-
-       if (timerTop == 0) {
-               return;
-       }
-       t = time(0);
-       while (k-- && t >= timer[k].alarm_time) {
-               if (timer[k].action) {
-                       /* monet_eval(timer[k].action, &restype); */
-                       GDKfree(timer[k].action);
-               } else {
-                       MT_sema_up(&timer[k].sema);
-               }
-               timerTop--;
-       }
-       if (timerTop > 0) {
-               alarm(timer[timerTop - 1].alarm_time - time(0));
-       }
-}
-#endif
-
 #include "mal.h"
 #include "mal_exception.h"
 
 
 str
-ALARMprelude(void *ret)
-{
-       (void) ret;
-#ifdef SIGALRM
-       if(signal(SIGALRM, (void (*)()) CLKsignal) == SIG_ERR)
-               throw(MAL, "alarm.prelude", SQLSTATE(HY001) "Signal call 
failed");
-#endif
-       return MAL_SUCCEED;
-}
-
-str
-ALARMepilogue(void *ret)
-{
-       int k;
-
-       (void) ret;
-#if (defined(SIGALRM) && defined(SIG_IGN))
-/* HACK to pacify compiler */
-#if (defined(__INTEL_COMPILER) && (SIZEOF_VOID_P > SIZEOF_INT))
-#undef  SIG_IGN                        /*((__sighandler_t)1 ) */
-#define SIG_IGN   ((__sighandler_t)1L)
-#endif
-       if(signal(SIGALRM, SIG_IGN) == SIG_ERR)
-               throw(MAL, "alarm.epilogue", SQLSTATE(HY001) "Signal call 
failed");
-#endif
-       for (k = 0; k < timerTop; k++) {
-               if (timer[k].action)
-                       GDKfree(timer[k].action);
-       }
-       return MAL_SUCCEED;
-}
-
-str
 ALARMusec(lng *ret)
 {
        *ret = GDKusec();
@@ -138,38 +49,11 @@ ALARMsleep(void *res, int *secs)
        if (*secs < 0)
                throw(MAL, "alarm.sleep", "negative delay");
 
-#ifdef __CYGWIN__
-       /* CYGWIN cannot handle SIGALRM with sleep */
-       {
-               lng t = GDKusec() + (*secs)*1000000;
-
-               while (GDKusec() < t)
-                       ;
-       }
-#else
        MT_sleep_ms(*secs * 1000);
-#endif
        return MAL_SUCCEED;
 }
 
 str
-ALARMsetalarm(void *res, int *secs, str *action)
-{
-       (void) res;
-       (void) secs;
-       (void) action;          /* foolc compiler */
-       throw(MAL, "alarm.setalarm", SQLSTATE(0A000) PROGRAM_NYI);
-}
-
-str
-ALARMtimers(bat *res, bat *actions)
-{
-       (void) res;             /* fool compiler */
-       (void) actions;         /* fool compiler */
-       throw(MAL, "alarm.timers", SQLSTATE(0A000) PROGRAM_NYI);
-}
-
-str
 ALARMctime(str *res)
 {
        time_t t = time(0);
diff --git a/monetdb5/modules/kernel/alarm.mal 
b/monetdb5/modules/kernel/alarm.mal
--- a/monetdb5/modules/kernel/alarm.mal
+++ b/monetdb5/modules/kernel/alarm.mal
@@ -10,14 +10,6 @@ unsafe command alarm.sleep(secs:int):voi
 address ALARMsleep
 comment "Sleep a few seconds";
 
-#command alarm.action(secs:int, action:str):void
-#address ALARMsetalarm
-#comment "Execute a MAL action after a few secs. NYI";
-
-#unsafe command alarm.timers() (time:bat[:str],action:bat[:str])
-#address ALARMtimers
-#comment "Give the list of all active timers. NYI";
-
 unsafe command alarm.usec() :lng
 address ALARMusec
 comment "Return time in microseconds.";
@@ -33,14 +25,3 @@ comment "Return the current time as UNIX
 unsafe command alarm.ctime() :str
 address ALARMctime
 comment "Return the current time as a C-time string.";
-
-command alarm.prelude():void
-address ALARMprelude
-comment "Initialize alarm module.";
-
-command alarm.epilogue():void
-address ALARMepilogue
-comment "Finalize alarm module.";
-
-alarm.prelude();
-
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to