diff options
author | Marc Alff <marc.alff@sun.com> | 2010-01-06 22:42:07 -0700 |
---|---|---|
committer | Marc Alff <marc.alff@sun.com> | 2010-01-06 22:42:07 -0700 |
commit | 3d915225611a921fad03934e58bf281b48fc15b0 (patch) | |
tree | ea8cbc9d70015a17aad75df30e7d223476eaa4da /sql/event_queue.cc | |
parent | 4b559b912f5a3aa02a226fdacddaa3b80a8ade42 (diff) | |
download | mariadb-git-3d915225611a921fad03934e58bf281b48fc15b0.tar.gz |
WL#2360 Performance schema
Part IV: sql instrumentation
Diffstat (limited to 'sql/event_queue.cc')
-rw-r--r-- | sql/event_queue.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sql/event_queue.cc b/sql/event_queue.cc index 04d4f858b43..7d987db411a 100644 --- a/sql/event_queue.cc +++ b/sql/event_queue.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2006 MySQL AB +/* Copyright (C) 2004-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -94,16 +94,16 @@ Event_queue::Event_queue() mutex_queue_data_attempting_lock(FALSE), waiting_on_cond(FALSE) { - pthread_mutex_init(&LOCK_event_queue, MY_MUTEX_INIT_FAST); - pthread_cond_init(&COND_queue_state, NULL); + mysql_mutex_init(key_LOCK_event_queue, &LOCK_event_queue, MY_MUTEX_INIT_FAST); + mysql_cond_init(key_COND_queue_state, &COND_queue_state, NULL); } Event_queue::~Event_queue() { deinit_queue(); - pthread_mutex_destroy(&LOCK_event_queue); - pthread_cond_destroy(&COND_queue_state); + mysql_mutex_destroy(&LOCK_event_queue); + mysql_cond_destroy(&COND_queue_state); } @@ -210,7 +210,7 @@ Event_queue::create_event(THD *thd, Event_queue_element *new_element, LOCK_QUEUE_DATA(); *created= (queue_insert_safe(&queue, (uchar *) new_element) == FALSE); dbug_dump_queue(thd->query_start()); - pthread_cond_broadcast(&COND_queue_state); + mysql_cond_broadcast(&COND_queue_state); UNLOCK_QUEUE_DATA(); DBUG_RETURN(!*created); @@ -258,7 +258,7 @@ Event_queue::update_event(THD *thd, LEX_STRING dbname, LEX_STRING name, { DBUG_PRINT("info", ("new event in the queue: 0x%lx", (long) new_element)); queue_insert_safe(&queue, (uchar *) new_element); - pthread_cond_broadcast(&COND_queue_state); + mysql_cond_broadcast(&COND_queue_state); } dbug_dump_queue(thd->query_start()); @@ -669,7 +669,7 @@ Event_queue::lock_data(const char *func, uint line) mutex_last_attempted_lock_in_func= func; mutex_last_attempted_lock_at_line= line; mutex_queue_data_attempting_lock= TRUE; - pthread_mutex_lock(&LOCK_event_queue); + mysql_mutex_lock(&LOCK_event_queue); mutex_last_attempted_lock_in_func= ""; mutex_last_attempted_lock_at_line= 0; mutex_queue_data_attempting_lock= FALSE; @@ -700,7 +700,7 @@ Event_queue::unlock_data(const char *func, uint line) mutex_last_unlocked_at_line= line; mutex_queue_data_locked= FALSE; mutex_last_unlocked_in_func= func; - pthread_mutex_unlock(&LOCK_event_queue); + mysql_mutex_unlock(&LOCK_event_queue); DBUG_VOID_RETURN; } @@ -731,9 +731,9 @@ Event_queue::cond_wait(THD *thd, struct timespec *abstime, const char* msg, DBUG_PRINT("info", ("pthread_cond_%swait", abstime? "timed":"")); if (!abstime) - pthread_cond_wait(&COND_queue_state, &LOCK_event_queue); + mysql_cond_wait(&COND_queue_state, &LOCK_event_queue); else - pthread_cond_timedwait(&COND_queue_state, &LOCK_event_queue, abstime); + mysql_cond_timedwait(&COND_queue_state, &LOCK_event_queue, abstime); mutex_last_locked_in_func= func; mutex_last_locked_at_line= line; |