1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Add macro for retrieving sec part of "struct timespec"

Use macros for working with "struct timespec" in event_queue.cc
Fix merge problem


include/my_pthread.h:
  Remove merge problem causing "struct timespec" to be declared twice
  Add macro "get_timespec_sec" used for retrieving the time in seconds
sql/event_queue.cc:
  Use macros for working with "struct timespec"
sql/log_event.cc:
  Add casts from "byte*" to "char*"
This commit is contained in:
unknown
2006-12-15 10:41:24 +01:00
parent 33ab28e9ad
commit eca724f45c
3 changed files with 18 additions and 17 deletions

View File

@@ -719,7 +719,6 @@ Event_queue::get_top_for_execution_if_time(THD *thd, Event_job_data **job_data)
*job_data= NULL;
DBUG_ENTER("Event_queue::get_top_for_execution_if_time");
top_time.tv_nsec= 0;
LOCK_QUEUE_DATA();
for (;;)
{
@@ -732,12 +731,12 @@ Event_queue::get_top_for_execution_if_time(THD *thd, Event_job_data **job_data)
if (queue.elements)
{
top= ((Event_queue_element*) queue_element(&queue, 0));
top_time.tv_sec= sec_since_epoch_TIME(&top->execute_at);
set_timespec(top_time, sec_since_epoch_TIME(&top->execute_at));
abstime= &top_time;
}
if (!abstime || abstime->tv_sec > now)
if (!abstime || get_timespec_sec(*abstime) > now)
{
const char *msg;
if (abstime)
@@ -816,8 +815,8 @@ end:
if (to_free)
delete top;
DBUG_PRINT("info", ("returning %d et_new: 0x%lx abstime.tv_sec: %ld ",
ret, (long) *job_data, abstime ? abstime->tv_sec : 0));
DBUG_PRINT("info", ("returning %d et_new: 0x%lx get_timespec_sec(abstime): %ld ",
ret, (long) *job_data, abstime ? get_timespec_sec(*abstime) : 0));
if (*job_data)
DBUG_PRINT("info", ("db: %s name: %s definer=%s", (*job_data)->dbname.str,