Index: bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.60
diff -u -F^function -r1.60 bootstrap.inc
--- bootstrap.inc	5 Aug 2005 00:49:02 -0000	1.60
+++ bootstrap.inc	5 Aug 2005 14:47:27 -0000
@@ -320,12 +320,13 @@ function cache_get($key) {
 function cache_set($cid, $data, $expire = CACHE_PERMANENT, $headers = NULL) {
   $data = db_encode_blob($data);
 
-  db_query('LOCK TABLES {cache} WRITE');
+  db_query('BEGIN');
+  db_query('LOCK TABLE {cache} IN ACCESS EXCLUSIVE MODE');
   db_query("UPDATE {cache} SET data = '%s', created = %d, expire = %d, headers = '%s' WHERE cid = '%s'", $data, time(), $expire, $headers, $cid);
   if (!db_affected_rows()) {
     @db_query("INSERT INTO {cache} (cid, data, created, expire, headers) VALUES ('%s', '%s', %d, %d, '%s')", $cid, $data, time(), $expire, $headers);
   }
-  db_query('UNLOCK TABLES');
+  db_query('COMMIT');
 }
 
 /**
