Attribute Macro proclock_macro::proclock

source · []
#[proclock]
Expand description

Wraps the annotated function with a lock that is released when the function is returned.

Args:

  • name: The name of the lock. Can be any relative / absolute path.
  • absolute: Indicates whether the provided name should be created at the temp_dir or as an absolute path (at the root directory). Default is false.
  • blocking: Indicates whether the acquiring the lock should be a blocking operation or not. Default is false.

Example

use proclock_macro::proclock;

#[proclock(name = "my_lock.lock", absolute = false, blocking = true)]
fn my_locked_function() {}