diff --git a/httprl.nonblocktest.inc b/httprl.nonblocktest.inc
index a97f150..55144f9 100644
--- a/httprl.nonblocktest.inc
+++ b/httprl.nonblocktest.inc
@@ -18,7 +18,27 @@ function httprl_nonblockingtest_page() {
   }
 
   // Release the lock, echo out that the lock was cleared and exit.
-  lock_release($_GET['id']);
+  if (variable_get('lock_inc', './includes/lock.inc') == './includes/lock.inc') {
+    lock_release($_GET['id']);
+  }
+  else {
+    httprl_lock_release($_GET['id']);
+  }
   echo t('lock @id cleared', array('@id' => $_GET['id']));
   exit;
 }
+
+/**
+ * Release a lock previously acquired by lock_acquire().
+ *
+ * This will release the named lock if it is still held by the current request.
+ *
+ * @param $name
+ *   The name of the lock.
+ */
+function httprl_lock_release($name) {
+  global $locks;
+
+  unset($locks[$name]);
+  db_query("DELETE FROM {semaphore} WHERE name = '%s'", $name);
+}
