@task(throws=(StaleDocumentsRenderingInProgress,))
def acquire_render_lock():
 if render_lock.locked():
  raise StaleDocumentsRenderingInProgress
 render_lock.acquire()

@ task ( throws = ( StaleDocumentsRenderingInProgress , ) ) def acquire_render_lock ( ) : if render_lock . locked ( ) : raise StaleDocumentsRenderingInProgress render_lock . acquire ( )
a task to acquire the render document lock .