StarPU Internal Handbook
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
rwlock.h File Reference
#include <stdint.h>
#include <starpu.h>

Go to the source code of this file.

Data Structures

struct  _starpu_rw_lock
 

Functions

void _starpu_init_rw_lock (struct _starpu_rw_lock *lock)
 
void _starpu_take_rw_lock_write (struct _starpu_rw_lock *lock)
 
void _starpu_take_rw_lock_read (struct _starpu_rw_lock *lock)
 
int _starpu_take_rw_lock_write_try (struct _starpu_rw_lock *lock)
 
int _starpu_take_rw_lock_read_try (struct _starpu_rw_lock *lock)
 
void _starpu_release_rw_lock (struct _starpu_rw_lock *lock)
 

Data Structure Documentation

struct _starpu_rw_lock

Dummy implementation of a RW-lock using a spinlock.

Data Fields
uint32_t busy
uint8_t writer
uint16_t readercnt

Function Documentation

void _starpu_init_rw_lock ( struct _starpu_rw_lock lock)

Initialize the RW-lock

void _starpu_take_rw_lock_write ( struct _starpu_rw_lock lock)

Grab the RW-lock in a write mode

void _starpu_take_rw_lock_read ( struct _starpu_rw_lock lock)

Grab the RW-lock in a read mode

int _starpu_take_rw_lock_write_try ( struct _starpu_rw_lock lock)

Try to grab the RW-lock in a write mode. Returns 0 in case of success, -1 otherwise.

int _starpu_take_rw_lock_read_try ( struct _starpu_rw_lock lock)

Try to grab the RW-lock in a read mode. Returns 0 in case of success, -1 otherwise.

void _starpu_release_rw_lock ( struct _starpu_rw_lock lock)

Unlock the RW-lock.