Send Linux-ha-cvs mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]
You can reach the person managing the list at
[EMAIL PROTECTED]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Linux-ha-cvs digest..."
Today's Topics:
1. Linux-HA CVS: lib by alan from ([email protected])
2. Linux-HA CVS: lib by alan from ([email protected])
3. Linux-HA CVS: lib by alan from ([email protected])
----------------------------------------------------------------------
Message: 1
Date: Mon, 30 Jan 2006 21:50:30 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: lib by alan from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : alan
Host :
Project : linux-ha
Module : lib
Dir : linux-ha/lib/clplumbing
Modified Files:
GSource.c
Log Message:
Forgot to commit this with the last round of changes...
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/clplumbing/GSource.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -3 -r1.54 -r1.55
--- GSource.c 30 Jan 2006 18:41:59 -0000 1.54
+++ GSource.c 31 Jan 2006 04:50:30 -0000 1.55
@@ -1,4 +1,4 @@
-/* $Id: GSource.c,v 1.54 2006/01/30 18:41:59 alan Exp $ */
+/* $Id: GSource.c,v 1.55 2006/01/31 04:50:30 alan Exp $ */
/*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -223,6 +223,7 @@
ret->gpfd.events = DEF_EVENTS;
ret->gpfd.revents = 0;
ret->dnotify = notify;
+ ret->detecttime = time_longclock();
g_source_add_poll(source, &ret->gpfd);
@@ -293,11 +294,8 @@
{
GFDSource* fdp = (GFDSource*)source;
g_assert(IS_FDSOURCE(fdp));
- if (fdp->gpfd.revents != 0) {
- fdp->detecttime = time_longclock();
- return TRUE;
- }
- return FALSE;
+ fdp->detecttime = time_longclock();
+ return fdp->gpfd.revents != 0;
}
/*
@@ -404,6 +402,7 @@
chp->magno = MAG_GCHSOURCE;
chp->maxdispatchdelayms = 0;
chp->maxdispatchms = 0;
+ chp->detecttime = time_longclock();
chp->ch = ch;
chp->dispatch = dispatch;
chp->udata=userdata;
@@ -522,7 +521,8 @@
*/
chp->infd.events &= ~INPUT_EVENTS;
}
-
+
+ chp->detecttime = time_longclock();
if (chp->dontread){
return FALSE;
}
@@ -552,9 +552,7 @@
ret = (chp->infd.revents != 0
|| (!chp->fd_fdx && chp->outfd.revents != 0)
|| chp->ch->ops->is_message_pending(chp->ch));
- if (ret) {
- chp->detecttime = time_longclock();
- }
+ chp->detecttime = time_longclock();
return ret;
}
@@ -611,8 +609,8 @@
CHECK_DISPATCH_TIME(chp);
return FALSE;
}
- CHECK_DISPATCH_TIME(chp);
}
+ CHECK_DISPATCH_TIME(chp);
if (chp->ch->ch_status == IPC_DISCONNECT){
return FALSE;
@@ -681,6 +679,7 @@
wcp->magno = MAG_GWCSOURCE;
wcp->maxdispatchdelayms = 0;
wcp->maxdispatchms = 0;
+ wcp->detecttime = time_longclock();
wcp->udata = userdata;
wcp->gpfd.fd = wch->ops->get_select_fd(wch);
wcp->gpfd.events = DEF_EVENTS;
@@ -754,8 +753,8 @@
GWCSource* wcp = (GWCSource*)source;
g_assert(IS_WCSOURCE(wcp));
+ wcp->detecttime = time_longclock();
if (wcp->gpfd.revents != 0) {
- wcp->detecttime = time_longclock();
return TRUE;
}
return FALSE;
@@ -791,13 +790,13 @@
}
rc = wcp->dispatch(ch, wcp->udata);
- CHECK_DISPATCH_TIME(wcp);
if(!rc) {
g_source_remove_poll(source, &wcp->gpfd);
g_source_unref(source);
break;
}
}
+ CHECK_DISPATCH_TIME(wcp);
return rc;
}
@@ -950,6 +949,7 @@
/* Don't let a timing window keep us in poll() forever */
*timeoutms = 1000;
+ sig_src->detecttime = time_longclock();
return sig_src->signal_triggered;
}
@@ -987,11 +987,11 @@
if(sig_src->dispatch) {
if(!(sig_src->dispatch(sig_src->signal, sig_src->udata))){
G_main_del_SignalHandler(sig_src);
- return FALSE;
CHECK_DISPATCH_TIME(sig_src);
+ return FALSE;
}
- CHECK_DISPATCH_TIME(sig_src);
}
+ CHECK_DISPATCH_TIME(sig_src);
return TRUE;
}
@@ -1111,8 +1111,11 @@
void
set_sigchld_proctrack(int priority)
{
- G_main_add_SignalHandler(priority, SIGCHLD
+ GSIGSource* src = G_main_add_SignalHandler(priority, SIGCHLD
, child_death_dispatch, NULL, NULL);
+
+ G_main_setmaxdispatchdelay((GSource*) src, 100);
+ G_main_setmaxdispatchtime((GSource*) src, 10);
return;
}
@@ -1227,6 +1230,7 @@
g_assert(IS_TRIGSOURCE(trig_src));
+ trig_src->detecttime = time_longclock();
return trig_src->manual_trigger;
}
------------------------------
Message: 2
Date: Tue, 31 Jan 2006 06:55:23 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: lib by alan from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : alan
Host :
Project : linux-ha
Module : lib
Dir : linux-ha/lib/clplumbing
Modified Files:
GSource.c
Log Message:
Moved a potentially questionable call from on a signal too off the signal.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/clplumbing/GSource.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -3 -r1.55 -r1.56
--- GSource.c 31 Jan 2006 04:50:30 -0000 1.55
+++ GSource.c 31 Jan 2006 13:55:22 -0000 1.56
@@ -1,4 +1,4 @@
-/* $Id: GSource.c,v 1.55 2006/01/31 04:50:30 alan Exp $ */
+/* $Id: GSource.c,v 1.56 2006/01/31 13:55:22 alan Exp $ */
/*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -965,6 +965,7 @@
g_assert(IS_SIGSOURCE(sig_src));
+ sig_src->detecttime = time_longclock();
return sig_src->signal_triggered;
}
@@ -1031,7 +1032,6 @@
}
g_assert(IS_SIGSOURCE(sig_src));
- sig_src->detecttime = time_longclock();
sig_src->signal_triggered = TRUE;
}
------------------------------
Message: 3
Date: Tue, 31 Jan 2006 08:23:39 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: lib by alan from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : alan
Host :
Project : linux-ha
Module : lib
Dir : linux-ha/lib/clplumbing
Modified Files:
GSource.c
Log Message:
Made sure all the GSource structures are uniform.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/clplumbing/GSource.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -3 -r1.56 -r1.57
--- GSource.c 31 Jan 2006 13:55:22 -0000 1.56
+++ GSource.c 31 Jan 2006 15:23:38 -0000 1.57
@@ -1,4 +1,4 @@
-/* $Id: GSource.c,v 1.56 2006/01/31 13:55:22 alan Exp $ */
+/* $Id: GSource.c,v 1.57 2006/01/31 15:23:38 alan Exp $ */
/*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -52,9 +52,9 @@
struct GFDSource_s {
GSource source;
unsigned magno; /* MAG_GFDSOURCE */
- long maxdispatchms; /* Maximum time to spend in the
dispatch function */
- long maxdispatchdelayms; /* Max delay before processing
*/
- longclock_t detecttime;
+ long maxdispatchms; /* Time limit for dispatch function */
+ long maxdispatchdelayms; /* Max delay before processing */
+ longclock_t detecttime; /* Time last input detected */
void* udata;
gboolean (*dispatch)(int fd, gpointer user_data);
GPollFD gpfd;
@@ -65,66 +65,48 @@
typedef gboolean (*GCHdispatch)(IPC_Channel* ch, gpointer user_data);
+#define COMMON_STRUCTSTART
\
+GSource source; /* Common glib struct - must be 1st */
\
+unsigned magno; /* Magic number */ \
+long maxdispatchms; /* Time limit for dispatch function */ \
+long maxdispatchdelayms; /* Max delay before processing */ \
+longclock_t detecttime; /* Time last input detected */ \
+void* udata; /* User-defined data */ \
+guint gsourceid; /* Source id of this source */ \
+GDestroyNotify dnotify
+
struct GCHSource_s {
- GSource source;
- unsigned magno; /* MAG_GCHSOURCE */
- long maxdispatchms; /* Maximum time to spend in the
dispatch function */
- long maxdispatchdelayms; /* Max delay before processing
*/
- longclock_t detecttime;
- void* udata;
+ COMMON_STRUCTSTART;
IPC_Channel* ch;
- gboolean (*dispatch)(IPC_Channel* ch, gpointer user_data);
- GDestroyNotify dnotify;
gboolean fd_fdx;
GPollFD infd;
GPollFD outfd;
- guint gsourceid;
gboolean dontread; /* TRUE when we don't want to read
* more input for a while - we're
* flow controlling the writer off
*/
+ gboolean (*dispatch)(IPC_Channel* ch, gpointer user_data);
};
struct GWCSource_s {
- GSource source;
- unsigned magno; /* MAG_GWCSOURCE */
- long maxdispatchms; /* Maximum time to spend in the
dispatch function */
- long maxdispatchdelayms; /* Max delay before
processing */
- longclock_t detecttime;
- void* udata;
+ COMMON_STRUCTSTART;
GPollFD gpfd;
- GDestroyNotify dnotify;
IPC_WaitConnection* wch;
IPC_Auth* auth_info;
gboolean (*dispatch)(IPC_Channel* accept_ch, gpointer udata);
- guint gsourceid;
};
struct GSIGSource_s {
- GSource source;
- unsigned magno; /* MAG_GCHSOURCE */
- long maxdispatchms; /* Maximum time to spend in the
dispatch function */
- long maxdispatchdelayms; /* Max delay before processing
*/
- longclock_t detecttime;
- void* udata;
+ COMMON_STRUCTSTART;
int signal;
gboolean signal_triggered;
gboolean (*dispatch)(int signal, gpointer user_data);
- GDestroyNotify dnotify;
- guint gsourceid;
};
struct GTRIGSource_s {
- GSource source;
- unsigned magno; /* MAG_GCHSOURCE */
- long maxdispatchms; /* Maximum time to spend in the
dispatch function */
- long maxdispatchdelayms; /* Max delay before processing
*/
- longclock_t detecttime;
- void* udata;
+ COMMON_STRUCTSTART;
gboolean manual_trigger;
gboolean (*dispatch)(gpointer user_data);
- GDestroyNotify dnotify;
- guint gsourceid;
};
#define ERR_EVENTS (G_IO_ERR|G_IO_NVAL)
@@ -1300,12 +1282,21 @@
G_main_setmaxdispatchdelay(GSource* s, unsigned long delayms)
{
GFDSource* fdp = (GFDSource*)s;
- g_assert(IS_ONEOFOURS(fdp));
+ if (!IS_ONEOFOURS(fdp)) {
+ cl_log(LOG_ERR
+ , "Attempt to set max dispatch delay on wrong object");
+ return;
+ }
fdp->maxdispatchdelayms = delayms;
}
void
G_main_setmaxdispatchtime(GSource* s, unsigned long dispatchms)
{
GFDSource* fdp = (GFDSource*)s;
+ if (!IS_ONEOFOURS(fdp)) {
+ cl_log(LOG_ERR
+ , "Attempt to set max dispatch time on wrong object");
+ return;
+ }
fdp->maxdispatchms = dispatchms;
}
------------------------------
_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
End of Linux-ha-cvs Digest, Vol 26, Issue 68
********************************************