SpECTRE  2021.08.02
Parallel::NodeLock Class Reference

A typesafe wrapper for a lock for synchronization of shared resources on a given node, with safe creation, destruction, and serialization. More...

#include <NodeLock.hpp>

Public Member Functions

 NodeLock (CkMigrateMessage *) noexcept
 
 NodeLock (const NodeLock &)=delete
 
NodeLockoperator= (const NodeLock &)=delete
 
 NodeLock (NodeLock &&moved_lock) noexcept
 
NodeLockoperator= (NodeLock &&moved_lock) noexcept
 
void lock () noexcept
 
bool try_lock () noexcept
 
void unlock () noexcept
 
void destroy () noexcept
 
bool is_destroyed () noexcept
 
void pup (PUP::er &p) noexcept
 

Detailed Description

A typesafe wrapper for a lock for synchronization of shared resources on a given node, with safe creation, destruction, and serialization.

Details

This structure is a thin wrapper around the charm CmiNodeLock, in the Converse library. On construction, this class creates a Converse nodelock, and frees the lock on destruction.

Note
If a locked NodeLock is serialized, it is deserialized as unlocked.