2000-09-06 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+ * glib.h, gtimer.c, tests/thread-test.c:
+ s/G_MICROSEC/G_USEC_PER_SEC/
+
* glib.h: Removed G_G{U}{SHORT|INT|LONG}_FORMAT from glib.h, as
they are really superfluous.
2000-09-06 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+ * glib.h, gtimer.c, tests/thread-test.c:
+ s/G_MICROSEC/G_USEC_PER_SEC/
+
* glib.h: Removed G_G{U}{SHORT|INT|LONG}_FORMAT from glib.h, as
they are really superfluous.
2000-09-06 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+ * glib.h, gtimer.c, tests/thread-test.c:
+ s/G_MICROSEC/G_USEC_PER_SEC/
+
* glib.h: Removed G_G{U}{SHORT|INT|LONG}_FORMAT from glib.h, as
they are really superfluous.
2000-09-06 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+ * glib.h, gtimer.c, tests/thread-test.c:
+ s/G_MICROSEC/G_USEC_PER_SEC/
+
* glib.h: Removed G_G{U}{SHORT|INT|LONG}_FORMAT from glib.h, as
they are really superfluous.
2000-09-06 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+ * glib.h, gtimer.c, tests/thread-test.c:
+ s/G_MICROSEC/G_USEC_PER_SEC/
+
* glib.h: Removed G_G{U}{SHORT|INT|LONG}_FORMAT from glib.h, as
they are really superfluous.
2000-09-06 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+ * glib.h, gtimer.c, tests/thread-test.c:
+ s/G_MICROSEC/G_USEC_PER_SEC/
+
* glib.h: Removed G_G{U}{SHORT|INT|LONG}_FORMAT from glib.h, as
they are really superfluous.
2000-09-06 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+ * glib.h, gtimer.c, tests/thread-test.c:
+ s/G_MICROSEC/G_USEC_PER_SEC/
+
* glib.h: Removed G_G{U}{SHORT|INT|LONG}_FORMAT from glib.h, as
they are really superfluous.
2000-09-06 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+ * glib.h, gtimer.c, tests/thread-test.c:
+ s/G_MICROSEC/G_USEC_PER_SEC/
+
* glib.h: Removed G_G{U}{SHORT|INT|LONG}_FORMAT from glib.h, as
they are really superfluous.
/* Timer
*/
-#define G_MICROSEC 1000000
+/* microseconds per second */
+#define G_USEC_PER_SEC 1000000
GTimer* g_timer_new (void);
void g_timer_destroy (GTimer *timer);
/* Timer
*/
-#define G_MICROSEC 1000000
+/* microseconds per second */
+#define G_USEC_PER_SEC 1000000
GTimer* g_timer_new (void);
void g_timer_destroy (GTimer *timer);
if (rtimer->start.tv_usec > rtimer->end.tv_usec)
{
- rtimer->end.tv_usec += G_MICROSEC;
+ rtimer->end.tv_usec += G_USEC_PER_SEC;
rtimer->end.tv_sec--;
}
g_get_current_time (&end_time);
- end_time.tv_sec += microseconds / G_MICROSEC;
- end_time.tv_usec += microseconds % G_MICROSEC;
+ end_time.tv_sec += microseconds / G_USEC_PER_SEC;
+ end_time.tv_usec += microseconds % G_USEC_PER_SEC;
- if (end_time.tv_usec >= G_MICROSEC)
+ if (end_time.tv_usec >= G_USEC_PER_SEC)
{
- end_time.tv_usec -= G_MICROSEC;
+ end_time.tv_usec -= G_USEC_PER_SEC;
end_time.tv_sec += 1;
}
else
{
struct timeval tv;
- tv.tv_sec = microseconds / G_MICROSEC;
- tv.tv_usec = microseconds % G_MICROSEC;
+ tv.tv_sec = microseconds / G_USEC_PER_SEC;
+ tv.tv_usec = microseconds % G_USEC_PER_SEC;
select(0, NULL, NULL, NULL, &tv);
}
#endif
+2000-09-06 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+
+ * gthread-posix.c, gthread-solaris.c:
+ s/G_MICROSEC/G_USEC_PER_SEC/ and s/G_NANOSEC/G_NSEC_PER_SEC/
+
2000-09-01 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gthread-posix.c (g_thread_create_posix_impl): Use GError to
without error check then!!!!, we might want to change this
therfore. */
-#define G_MICROSEC 1000000
-#define G_NANOSEC 1000000000
+#define G_NSEC_PER_SEC 1000000000
static gboolean
g_cond_timed_wait_posix_impl (GCond * cond,
}
end_time.tv_sec = abs_time->tv_sec;
- end_time.tv_nsec = abs_time->tv_usec * (G_NANOSEC / G_MICROSEC);
- g_assert (end_time.tv_nsec < G_NANOSEC);
+ end_time.tv_nsec = abs_time->tv_usec * (G_NSEC_PER_SEC / G_USEC_PER_SEC);
+ g_assert (end_time.tv_nsec < G_NSEC_PER_SEC);
result = pthread_cond_timedwait ((pthread_cond_t *) cond,
(pthread_mutex_t *) entered_mutex,
&end_time);
without error check then!!!!, we might want to change this
therfore. */
-#define G_MICROSEC 1000000
-#define G_NANOSEC 1000000000
+#define G_NSEC_PER_SEC 1000000000
static gboolean
g_cond_timed_wait_solaris_impl (GCond * cond,
}
end_time.tv_sec = abs_time->tv_sec;
- end_time.tv_nsec = abs_time->tv_usec * (G_NANOSEC / G_MICROSEC);
- g_assert (end_time.tv_nsec < G_NANOSEC);
+ end_time.tv_nsec = abs_time->tv_usec * (G_NSEC_PER_SEC / G_USEC_PER_SEC);
+ g_assert (end_time.tv_nsec < G_NSEC_PER_SEC);
result = cond_timedwait ((cond_t *) cond, (mutex_t *) entered_mutex,
&end_time);
timed_out = (result == ETIME);
if (rtimer->start.tv_usec > rtimer->end.tv_usec)
{
- rtimer->end.tv_usec += G_MICROSEC;
+ rtimer->end.tv_usec += G_USEC_PER_SEC;
rtimer->end.tv_sec--;
}
g_get_current_time (&end_time);
- end_time.tv_sec += microseconds / G_MICROSEC;
- end_time.tv_usec += microseconds % G_MICROSEC;
+ end_time.tv_sec += microseconds / G_USEC_PER_SEC;
+ end_time.tv_usec += microseconds % G_USEC_PER_SEC;
- if (end_time.tv_usec >= G_MICROSEC)
+ if (end_time.tv_usec >= G_USEC_PER_SEC)
{
- end_time.tv_usec -= G_MICROSEC;
+ end_time.tv_usec -= G_USEC_PER_SEC;
end_time.tv_sec += 1;
}
else
{
struct timeval tv;
- tv.tv_sec = microseconds / G_MICROSEC;
- tv.tv_usec = microseconds % G_MICROSEC;
+ tv.tv_sec = microseconds / G_USEC_PER_SEC;
+ tv.tv_usec = microseconds % G_USEC_PER_SEC;
select(0, NULL, NULL, NULL, &tv);
}
#endif
thread = g_thread_create (test_g_mutex_thread,
GINT_TO_POINTER (42),
0, TRUE, TRUE, G_THREAD_PRIORITY_NORMAL, NULL);
- g_usleep (G_MICROSEC);
+ g_usleep (G_USEC_PER_SEC);
test_g_mutex_int = 42;
G_UNLOCK (test_g_mutex);
g_mutex_unlock (test_g_mutex_mutex);
thread = g_thread_create (test_g_static_rec_mutex_thread,
GINT_TO_POINTER (42),
0, TRUE, TRUE, G_THREAD_PRIORITY_NORMAL, NULL);
- g_usleep (G_MICROSEC);
+ g_usleep (G_USEC_PER_SEC);
g_assert (g_static_rec_mutex_trylock (&test_g_static_rec_mutex_mutex));
- g_usleep (G_MICROSEC);
+ g_usleep (G_USEC_PER_SEC);
test_g_static_rec_mutex_int = 41;
g_static_rec_mutex_unlock (&test_g_static_rec_mutex_mutex);
test_g_static_rec_mutex_int = 42;
g_static_rec_mutex_unlock (&test_g_static_rec_mutex_mutex);
- g_usleep (G_MICROSEC);
+ g_usleep (G_USEC_PER_SEC);
g_static_rec_mutex_lock (&test_g_static_rec_mutex_mutex);
test_g_static_rec_mutex_int = 0;
g_static_rec_mutex_unlock (&test_g_static_rec_mutex_mutex);
test_g_static_private_destructor);
}
*private = number;
- g_usleep (G_MICROSEC / 5);
+ g_usleep (G_USEC_PER_SEC / 5);
g_assert (number == *private);
}
}
0, 0, TRUE, TRUE,
G_THREAD_PRIORITY_NORMAL, NULL);
}
- g_usleep (G_MICROSEC);
+ g_usleep (G_USEC_PER_SEC);
test_g_static_rw_lock_run = FALSE;
for (i = 0; i < THREADS; i++)
{