Debabrata Debroy
2010-Nov-22 05:05 UTC
[zfs-discuss] X11 XtAppAddTimeOut is not working properly.
Hi All
I have written Following program so that fun() gets called by every 10 mili
seconds.But after executing the program I Found its calling the function after
20 mili seconds.If I specify timeinterval as 20 mili second in XtAppAddTimeOut
function its calling fun method after 30 mili seconds.
Here is my Code :
XtIntervalId main_timer;
static XtAppContext app_context;
unsigned long interval=10;
void setup();
void fun()
{
time_t curtime;
char buffer[30];
struct timeval tv;
gettimeofday(&tv, NULL);
curtime=tv.tv_sec;
strftime(buffer,30,"%m-%d-%Y %T.",localtime(&curtime));
//printf("%s%ld\n",buffer,tv.tv_usec/1000);
cout<<buffer<<"-"<<tv.tv_usec/1000<<"##EXIT##Received
SIGTERM signal"<<endl;
//LOG_AXIS_INFO("##EXIT##Received SIGTERM signal");
setup();
}
void TimeOutCB(XtPointer cl_data, XtIntervalId *timer)
{
fun();
}
void setup()
{
//setup();
XtAppAddTimeOut(app_context, interval, TimeOutCB, NULL);
}
int main(int argc, char *argv[])
{
argc = 2;
char* argv1[] = {"One", "Two"};
XtVaAppInitialize (&app_context, "ConfigFileReaderTest", NULL, 0,
&argc, argv1, NULL, NULL);
setup();
// signal( SIGTERM, handleSigTerm );
while(1)
{
XtAppProcessEvent(app_context, XtIMAll);
}
return 0;
}
X11 library I am using is ./libX11.so.5.
Enterprise Solaris Version is Solaris 10 update 9
Can you please suggest whether there is any fix for it .As same code I have seen
is working with Linux .
--
This message posted from opensolaris.org
Debabrata Debroy
2010-Nov-22 05:08 UTC
[zfs-discuss] X11 XtAppAddTimeOut is not working properly.
Hi All I have written Following program so that fun() gets called by every 10 mili seconds.But after executing the program I Found its calling the function after 20 mili seconds.If I specify timeinterval as 20 mili second in XtAppAddTimeOut function its calling fun method after 30 mili seconds. I am attaching my code . Solaris Version I am using it Solaris 10 updated 9 X11c library version is libX11.so.5 Please let me know if there is any fix available for it . -- This message posted from opensolaris.org -------------- next part -------------- A non-text attachment was scrubbed... Name: test.cpp Type: application/octet-stream Size: 1181 bytes Desc: not available URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20101121/e921070d/attachment.obj>