+// Uncached doing_cron transient fetch
+function _get_cron_lock() {
+ global $_wp_using_ext_object_cache, $wpdb;
+
+ $value = 0;
+ if ( $_wp_using_ext_object_cache ) {
+ // Skip local cache and force refetch of doing_cron transient in case
+ // another processs updated the cache
+ $value = wp_cache_get( 'doing_cron', 'transient', true );
+ } else {
+ $row = $wpdb->get_row( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1", '_transient_doing_cron' ) );
+ if ( is_object( $row ) )
+ $value = $row->option_value;
+ }
+
+ return $value;
+}
+
+if ( false === $crons = _get_cron_array() )
+ die();