diff --git a/core/includes/common.inc b/core/includes/common.inc
index c9913a2..0c7c2a7 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -5071,12 +5071,12 @@ function drupal_cron_run() {
  * @see drupal_register_shutdown_function()
  */
 function drupal_cron_cleanup() {
-  // See if the semaphore is still locked.
-  if (variable_get('cron_semaphore', FALSE)) {
+  // See if the cron is still locked.
+  if (!lock()->lockMayBeAvailable('cron')) {
     watchdog('cron', 'Cron run exceeded the time limit and was aborted.', array(), WATCHDOG_WARNING);
 
-    // Release cron semaphore.
-    variable_del('cron_semaphore');
+    // Release cron lock.
+    lock()->release('cron');
   }
 }
 
