function _background_process_ensure_cleanup in Background Process 6
Same name and namespace in other branches
- 8 background_process.module \_background_process_ensure_cleanup()
- 7 background_process.module \_background_process_ensure_cleanup()
Ensure lock is removed at end of request
Parameters
$handle: Handle of background process
$remove: If TRUE, don't remove when shutting down
3 calls to _background_process_ensure_cleanup()
File
- ./
background_process.module, line 1354
Code
function _background_process_ensure_cleanup($handle, $remove = FALSE) {
$handles =& background_process_static('background_process_handles_locked', NULL);
if (!isset($handles)) {
$handles = array();
register_shutdown_function('_background_process_cleanup_locks');
}
if ($remove) {
unset($handles[$handle]);
}
else {
$handles[$handle] = $handle;
}
}