try_lock

try_lock#

stdgpu: stdgpu::mutex_array::reference::try_lock
stdgpu Latest
Efficient STL-like Data Structures on the GPU

◆ try_lock()

template<typename Block = mutex_default_type, typename Allocator = safe_device_allocator<Block>>
STDGPU_DEVICE_ONLY bool stdgpu::mutex_array< Block, Allocator >::reference::try_lock ( )

Tries to lock the mutex.

Returns
True if the mutex has been locked, false otherwise