The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

Name

SPVM::Sync::Mutex - Mutex

Description

The Sync::Mutex class in SPVM has methods to manipulate mutex.

Usage

  use Sync::Mutex;
  
  my $mutex = Sync::Mutex->new;
  
  $mutex->lock;
  
  $mutex->unlock;

Class Methods

static method new : Sync::Mutex ();

Creates a new Sync::Mutex object, initializes it by calling the new_instance mutex native API, and returns it.

Instance Methods

DESTROY

method DESTROY : void ();

Destroys this instance by calling the free_instance mutex native API

lock

method lock : void ();

Locks this mutex by calling the lock mutex native API.

unlock

method unlock : void ();

UnLocks this mutex by calling the unlock mutex native API.

reader_lock

method reader_lock : void ();

Locks this mutex for reading by calling the reader_lock mutex native API.

reader_unlock

method reader_unlock : void ();

UnLocks this mutex locked by the "reader_lock" method by calling the reader_unlock mutex native API.

Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License