From 9f33f00d3501db43c2bbbc01671383814ab8e64a Mon Sep 17 00:00:00 2001 From: Neil Drumm Date: Sun, 25 Mar 2007 20:50:26 +0000 Subject: [PATCH] Patch #80963 by Dries et al: fixed race condition in _block_rehash(). Backport from HEAD. --- modules/block/block.module | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/block/block.module b/modules/block/block.module index 3cd7edb6701..07e7600d753 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -148,6 +148,8 @@ function _block_rehash() { init_theme(); + db_lock_table('blocks'); + $result = db_query("SELECT * FROM {blocks} WHERE theme = '%s'", $theme_key); while ($old_block = db_fetch_object($result)) { $old_blocks[$old_block->module][$old_block->delta] = $old_block; @@ -187,7 +189,6 @@ function _block_rehash() { } } - db_lock_table('blocks'); // Remove all blocks from table. db_query("DELETE FROM {blocks} WHERE theme = '%s'", $theme_key);