StarPU Internal Handbook

Data Structures | Functions
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

## ◆ _starpu_rw_lock

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

## ◆ _starpu_init_rw_lock()

void _starpu_init_rw_lock | ( | struct _starpu_rw_lock * | lock | ) |

Initialize the RW-lock

## ◆ _starpu_take_rw_lock_write()

void _starpu_take_rw_lock_write | ( | struct _starpu_rw_lock * | lock | ) |

Grab the RW-lock in a write mode

## ◆ _starpu_take_rw_lock_read()

void _starpu_take_rw_lock_read | ( | struct _starpu_rw_lock * | lock | ) |

Grab the RW-lock in a read mode

## ◆ _starpu_take_rw_lock_write_try()

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.

## ◆ _starpu_take_rw_lock_read_try()

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.

## ◆ _starpu_release_rw_lock()

void _starpu_release_rw_lock | ( | struct _starpu_rw_lock * | lock | ) |

Unlock the RW-lock.