mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-03 14:42:10 +01:00
Dec 18 12:51:39 1998 Owen Taylor <otaylor@redhat.com>
* gmain.c: Fix errors in computation of timeout expiration times > 1sec.
This commit is contained in:
parent
ab4b645486
commit
2623d2831a
@ -1,3 +1,8 @@
|
|||||||
|
Fri Dec 18 12:51:39 1998 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gmain.c: Fix errors in computation of timeout
|
||||||
|
expiration times > 1sec.
|
||||||
|
|
||||||
1998-12-18 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
1998-12-18 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
||||||
|
|
||||||
* configure.in (have_threads): Changed the last pthread_cond_init
|
* configure.in (have_threads): Changed the last pthread_cond_init
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
Fri Dec 18 12:51:39 1998 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gmain.c: Fix errors in computation of timeout
|
||||||
|
expiration times > 1sec.
|
||||||
|
|
||||||
1998-12-18 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
1998-12-18 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
||||||
|
|
||||||
* configure.in (have_threads): Changed the last pthread_cond_init
|
* configure.in (have_threads): Changed the last pthread_cond_init
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
Fri Dec 18 12:51:39 1998 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gmain.c: Fix errors in computation of timeout
|
||||||
|
expiration times > 1sec.
|
||||||
|
|
||||||
1998-12-18 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
1998-12-18 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
||||||
|
|
||||||
* configure.in (have_threads): Changed the last pthread_cond_init
|
* configure.in (have_threads): Changed the last pthread_cond_init
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
Fri Dec 18 12:51:39 1998 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gmain.c: Fix errors in computation of timeout
|
||||||
|
expiration times > 1sec.
|
||||||
|
|
||||||
1998-12-18 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
1998-12-18 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
||||||
|
|
||||||
* configure.in (have_threads): Changed the last pthread_cond_init
|
* configure.in (have_threads): Changed the last pthread_cond_init
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
Fri Dec 18 12:51:39 1998 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gmain.c: Fix errors in computation of timeout
|
||||||
|
expiration times > 1sec.
|
||||||
|
|
||||||
1998-12-18 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
1998-12-18 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
||||||
|
|
||||||
* configure.in (have_threads): Changed the last pthread_cond_init
|
* configure.in (have_threads): Changed the last pthread_cond_init
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
Fri Dec 18 12:51:39 1998 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gmain.c: Fix errors in computation of timeout
|
||||||
|
expiration times > 1sec.
|
||||||
|
|
||||||
1998-12-18 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
1998-12-18 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
||||||
|
|
||||||
* configure.in (have_threads): Changed the last pthread_cond_init
|
* configure.in (have_threads): Changed the last pthread_cond_init
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
Fri Dec 18 12:51:39 1998 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gmain.c: Fix errors in computation of timeout
|
||||||
|
expiration times > 1sec.
|
||||||
|
|
||||||
1998-12-18 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
1998-12-18 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
||||||
|
|
||||||
* configure.in (have_threads): Changed the last pthread_cond_init
|
* configure.in (have_threads): Changed the last pthread_cond_init
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
Fri Dec 18 12:51:39 1998 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gmain.c: Fix errors in computation of timeout
|
||||||
|
expiration times > 1sec.
|
||||||
|
|
||||||
1998-12-18 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
1998-12-18 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
||||||
|
|
||||||
* configure.in (have_threads): Changed the last pthread_cond_init
|
* configure.in (have_threads): Changed the last pthread_cond_init
|
||||||
|
15
glib/gmain.c
15
glib/gmain.c
@ -832,8 +832,11 @@ g_timeout_dispatch (gpointer source_data,
|
|||||||
|
|
||||||
if (data->callback(user_data))
|
if (data->callback(user_data))
|
||||||
{
|
{
|
||||||
data->expiration.tv_sec = current_time->tv_sec;
|
guint seconds = data->interval / 1000;
|
||||||
data->expiration.tv_usec = current_time->tv_usec + data->interval * 1000;
|
guint msecs = data->interval - seconds * 1000;
|
||||||
|
|
||||||
|
data->expiration.tv_sec = current_time->tv_sec + seconds;
|
||||||
|
data->expiration.tv_usec = current_time->tv_usec + msecs * 1000;
|
||||||
if (data->expiration.tv_usec >= 1000000)
|
if (data->expiration.tv_usec >= 1000000)
|
||||||
{
|
{
|
||||||
data->expiration.tv_usec -= 1000000;
|
data->expiration.tv_usec -= 1000000;
|
||||||
@ -852,13 +855,19 @@ g_timeout_add_full (gint priority,
|
|||||||
gpointer data,
|
gpointer data,
|
||||||
GDestroyNotify notify)
|
GDestroyNotify notify)
|
||||||
{
|
{
|
||||||
|
guint seconds;
|
||||||
|
guint msecs;
|
||||||
GTimeoutData *timeout_data = g_new (GTimeoutData, 1);
|
GTimeoutData *timeout_data = g_new (GTimeoutData, 1);
|
||||||
|
|
||||||
timeout_data->interval = interval;
|
timeout_data->interval = interval;
|
||||||
timeout_data->callback = function;
|
timeout_data->callback = function;
|
||||||
g_get_current_time (&timeout_data->expiration);
|
g_get_current_time (&timeout_data->expiration);
|
||||||
|
|
||||||
timeout_data->expiration.tv_usec += timeout_data->interval * 1000;
|
seconds = timeout_data->interval / 1000;
|
||||||
|
msecs = timeout_data->interval - seconds * 1000;
|
||||||
|
|
||||||
|
timeout_data->expiration.tv_sec += seconds;
|
||||||
|
timeout_data->expiration.tv_usec += msecs * 1000;
|
||||||
if (timeout_data->expiration.tv_usec >= 1000000)
|
if (timeout_data->expiration.tv_usec >= 1000000)
|
||||||
{
|
{
|
||||||
timeout_data->expiration.tv_usec -= 1000000;
|
timeout_data->expiration.tv_usec -= 1000000;
|
||||||
|
15
gmain.c
15
gmain.c
@ -832,8 +832,11 @@ g_timeout_dispatch (gpointer source_data,
|
|||||||
|
|
||||||
if (data->callback(user_data))
|
if (data->callback(user_data))
|
||||||
{
|
{
|
||||||
data->expiration.tv_sec = current_time->tv_sec;
|
guint seconds = data->interval / 1000;
|
||||||
data->expiration.tv_usec = current_time->tv_usec + data->interval * 1000;
|
guint msecs = data->interval - seconds * 1000;
|
||||||
|
|
||||||
|
data->expiration.tv_sec = current_time->tv_sec + seconds;
|
||||||
|
data->expiration.tv_usec = current_time->tv_usec + msecs * 1000;
|
||||||
if (data->expiration.tv_usec >= 1000000)
|
if (data->expiration.tv_usec >= 1000000)
|
||||||
{
|
{
|
||||||
data->expiration.tv_usec -= 1000000;
|
data->expiration.tv_usec -= 1000000;
|
||||||
@ -852,13 +855,19 @@ g_timeout_add_full (gint priority,
|
|||||||
gpointer data,
|
gpointer data,
|
||||||
GDestroyNotify notify)
|
GDestroyNotify notify)
|
||||||
{
|
{
|
||||||
|
guint seconds;
|
||||||
|
guint msecs;
|
||||||
GTimeoutData *timeout_data = g_new (GTimeoutData, 1);
|
GTimeoutData *timeout_data = g_new (GTimeoutData, 1);
|
||||||
|
|
||||||
timeout_data->interval = interval;
|
timeout_data->interval = interval;
|
||||||
timeout_data->callback = function;
|
timeout_data->callback = function;
|
||||||
g_get_current_time (&timeout_data->expiration);
|
g_get_current_time (&timeout_data->expiration);
|
||||||
|
|
||||||
timeout_data->expiration.tv_usec += timeout_data->interval * 1000;
|
seconds = timeout_data->interval / 1000;
|
||||||
|
msecs = timeout_data->interval - seconds * 1000;
|
||||||
|
|
||||||
|
timeout_data->expiration.tv_sec += seconds;
|
||||||
|
timeout_data->expiration.tv_usec += msecs * 1000;
|
||||||
if (timeout_data->expiration.tv_usec >= 1000000)
|
if (timeout_data->expiration.tv_usec >= 1000000)
|
||||||
{
|
{
|
||||||
timeout_data->expiration.tv_usec -= 1000000;
|
timeout_data->expiration.tv_usec -= 1000000;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user