summaryrefslogtreecommitdiff
path: root/sql/sql_cache.cc
diff options
context:
space:
mode:
authorcmiller@zippy.cornsilk.net <>2007-11-07 13:25:20 -0500
committercmiller@zippy.cornsilk.net <>2007-11-07 13:25:20 -0500
commit1604cdb30deb1167f4a9ac0ae34ec171f6c6497f (patch)
tree4d1fff7efb5c0a6a068b26db4aec58c3c745c9eb /sql/sql_cache.cc
parent3cf16df04f9950726a3bfaa903db9cc4bedad6ff (diff)
parentaf22cc408c7ae0471912fd48c9e7012a73fda68b (diff)
downloadmariadb-git-1604cdb30deb1167f4a9ac0ae34ec171f6c6497f.tar.gz
Merge mysqldev@production.mysql.com:/data0/mysqldev/my/mysql-5.0-release
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community
Diffstat (limited to 'sql/sql_cache.cc')
-rw-r--r--sql/sql_cache.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 84f715a5a1d..8ca96a2bddc 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -1035,12 +1035,14 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
Query_cache_block_table *block_table, *block_table_end;
ulong tot_length;
Query_cache_query_flags flags;
+#ifndef __WIN__
const uint spin_treshold= 50000;
const double lock_time_treshold= 0.1; /* Time in seconds */
uint spin_count= 0;
int lock_status= 0;
ulong new_time= 0;
ulong stop_time= 0;
+#endif
DBUG_ENTER("Query_cache::send_result_to_client");
@@ -1088,6 +1090,9 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
}
}
+#ifdef __WIN__
+ STRUCT_LOCK(&structure_guard_mutex);
+#else
stop_time= my_clock()+(ulong)lock_time_treshold*CLOCKS_PER_SEC;
while ((lock_status= pthread_mutex_trylock(&structure_guard_mutex)) == EBUSY
&& spin_count < spin_treshold
@@ -1110,6 +1115,7 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
thd->lex->safe_to_cache_query= FALSE;
goto err;
}
+#endif
if (query_cache_size == 0 || flush_in_progress)
{