Loading...
Searching...
No Matches
Consumer
Shared Memory Library » Chunks
Collaboration diagram for Consumer:

## Functions

long | l4shmc_chunk_try_to_take_for_reading (l4shmc_chunk_t *chunk)
| Try to mark chunk busy reading.
long | l4shmc_enable_chunk (l4shmc_chunk_t *chunk)
| Enable a signal connected with a chunk.
long | l4shmc_wait_chunk (l4shmc_chunk_t *chunk)
| Wait on a specific chunk.
long | l4shmc_wait_chunk_to (l4shmc_chunk_t *chunk, l4_timeout_t timeout)
| Check whether a specific chunk has an event pending, with timeout.
long | l4shmc_wait_chunk_try (l4shmc_chunk_t *chunk)
| Check whether a specific chunk has an event pending.
long | l4shmc_chunk_consumed (l4shmc_chunk_t *chunk)
| Mark a chunk as free.
long | l4shmc_is_chunk_ready (l4shmc_chunk_t const *chunk)
| Check whether data is available.
long | l4shmc_chunk_size (l4shmc_chunk_t const *chunk)
| Get current size of a chunk.

## Detailed Description

## Function Documentation

## l4shmc_chunk_consumed()

long l4shmc_chunk_consumed | ( | l4shmc_chunk_t * | chunk | ) |

inline

Mark a chunk as free.

Parameters

  chunk | Chunk to mark as free.

Return values

  0 | Success.
  <0 | Error.

Examples
  examples/libs/shmc/prodcons.c.

References L4_CV.

## l4shmc_chunk_size()

long l4shmc_chunk_size | ( | l4shmc_chunk_t const * | chunk | ) |

inline

Get current size of a chunk.

Parameters

  chunk | Chunk.

Returns
  Current size of the chunk in bytes.

Examples
  examples/libs/shmc/prodcons.c.

References L4_CV, and L4_INLINE.

## l4shmc_chunk_try_to_take_for_reading()

long l4shmc_chunk_try_to_take_for_reading | ( | l4shmc_chunk_t * | chunk | ) |

inline

Try to mark chunk busy reading.

Parameters

  chunk | chunk to mark busy reading.

Return values

  0 | Chunk could be taken and can be read.
  <0 | Chunk could not be taken, try again.

References L4_CV, and L4_INLINE.

## l4shmc_enable_chunk()

long l4shmc_enable_chunk | ( | l4shmc_chunk_t * | chunk | ) |

Enable a signal connected with a chunk.

Parameters

  chunk | Chunk to enable.

Return values

  0 | Success.
  <0 | Error.

A signal must be enabled before waiting when the consumer waits on any signal. Enabling is not needed if the consumer waits for a specific signal or chunk.

References L4_CV, and L4_INLINE.

## l4shmc_is_chunk_ready()

long l4shmc_is_chunk_ready | ( | l4shmc_chunk_t const * | chunk | ) |

inline

Check whether data is available.

Parameters

  chunk | Chunk to check.

Return values

  !=0 | Data is available.
  0 | No data available.

References L4_CV, and L4_INLINE.

## l4shmc_wait_chunk()

long l4shmc_wait_chunk | ( | l4shmc_chunk_t * | chunk | ) |

inline

Wait on a specific chunk.

Parameters

  chunk | Chunk to wait for.

Return values

  0 | Success.
  <0 | Error.

Examples
  examples/libs/shmc/prodcons.c.

References L4_CV.

## l4shmc_wait_chunk_to()

long l4shmc_wait_chunk_to | ( | l4shmc_chunk_t * | chunk,
|  | l4_timeout_t | timeout )

Check whether a specific chunk has an event pending, with timeout.

Parameters

  chunk | Chunk to check.
  timeout | Timeout.

Return values

  0 | Success.
  <0 | Error.

The return code indicates whether an event was pending or not. Success means an event was pending, if an receive timeout error is returned no event was pending.

References L4_CV, and L4_INLINE.

## l4shmc_wait_chunk_try()

long l4shmc_wait_chunk_try | ( | l4shmc_chunk_t * | chunk | ) |

inline

Check whether a specific chunk has an event pending.

Parameters

  chunk | Chunk to check.

Return values

  0 | Success.
  <0 | Error.

The return code indicates whether an event was pending or not. Success means an event was pending, if an receive timeout error is returned no event was pending.

References L4_CV, and L4_INLINE.