Index: src/wp-admin/includes/class-wp-upgrader.php
===================================================================
--- src/wp-admin/includes/class-wp-upgrader.php	(revision 25825)
+++ src/wp-admin/includes/class-wp-upgrader.php	(working copy)
@@ -1736,18 +1736,37 @@
 	 * Kicks off a upgrade request for each item in the upgrade "queue"
 	 */
 	function run() {
+		global $wpdb;
+
 		$lock_name = 'auto_upgrader.lock';
-		if ( get_site_option( $lock_name ) ) {
-			// Test to see if it was set more than an hour ago, if so, cleanup.
-			if ( get_site_option( $lock_name ) < ( time() - HOUR_IN_SECONDS ) )
-				delete_site_option( $lock_name );
-			else // The process is already locked
+
+		// Try to lock, in Multisite we always run in the context of the main site
+		if ( is_multisite() && ! is_main_site() )
+			switch_to_blog( 1 );
+
+		$lock_result = $wpdb->query( $wpdb->prepare( "INSERT IGNORE INTO `$wpdb->options` ( `option_name`, `option_value`, `autoload` ) VALUES (%s, %s, 'no') /* LOCK */", $lock_name, time() ) );
+
+		if ( ! $lock_result ) {
+			$lock_result = get_option( $lock_name );
+
+			// If we couldn't create a lock, and there isn't a lock, bail
+			if ( ! $lock_result ) {
+				if ( is_multisite() )
+					restore_current_blog();
 				return;
+			}
+
+			// Check to see if the lock is still valid
+			if ( $lock_result > ( time() - HOUR_IN_SECONDS ) ) {
+				if ( is_multisite() )
+					restore_current_blog();
+				return;
+			}
 		}
-		// Lock upgrades for us for half an hour
-		if ( ! add_site_option( $lock_name, microtime( true ), HOUR_IN_SECONDS / 2 ) )
-			return;
 
+		// Update the lock, as by this point we've definately got a lock, just need to fire the actions
+		update_option( $lock_name, time() );
+
 		// Don't automatically run these thins, as we'll handle it ourselves
 		remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 ); 
 		remove_action( 'upgrader_process_complete', 'wp_version_check' ); 
@@ -1829,8 +1848,11 @@
 		$this->send_debug_email();
 
 		// Clear the lock
-		delete_site_option( $lock_name );
+		delete_option( $lock_name );
 
+		if ( is_multisite() )
+			restore_current_blog();
+
 	}
 
 	function send_debug_email() {
