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

## Functions

long | l4shmc_chunk_try_to_take (l4shmc_chunk_t *chunk)
| Try to mark chunk busy.
long | l4shmc_chunk_try_to_take_for_writing (l4shmc_chunk_t *chunk)
| Try to mark chunk busy writing.
long | l4shmc_chunk_try_to_take_for_overwriting (l4shmc_chunk_t *chunk)
| Try to mark the chunk busy writing after it was ready for reading.
long | l4shmc_chunk_ready (l4shmc_chunk_t *chunk, l4_umword_t size)
| Mark chunk as filled (ready).
long | l4shmc_chunk_ready_sig (l4shmc_chunk_t *chunk, l4_umword_t size)
| Mark chunk as filled (ready) and signal consumer.
long | l4shmc_is_chunk_clear (l4shmc_chunk_t const *chunk)
| Check whether chunk is free.

## Detailed Description

## Function Documentation

## l4shmc_chunk_ready()

long l4shmc_chunk_ready | ( | l4shmc_chunk_t * | chunk,
|  | l4_umword_t | size )

inline

Mark chunk as filled (ready).

Parameters

  chunk | chunk.
  size | Size of data in the chunk, in bytes.

Return values

  0 | Success.
  <0 | Error.

References L4_CV, and L4_INLINE.

## l4shmc_chunk_ready_sig()

long l4shmc_chunk_ready_sig | ( | l4shmc_chunk_t * | chunk,
|  | l4_umword_t | size )

inline

Mark chunk as filled (ready) and signal consumer.

Parameters

  chunk | chunk.
  size | Size of data in the chunk, in bytes.

Return values

  0 | Success.
  <0 | Error.

Examples
  examples/libs/shmc/prodcons.c.

References L4_CV, and L4_INLINE.

## l4shmc_chunk_try_to_take()

long l4shmc_chunk_try_to_take | ( | l4shmc_chunk_t * | chunk | ) |

inline

Try to mark chunk busy.

Parameters

  chunk | chunk to mark.

Return values

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

Examples
  examples/libs/shmc/prodcons.c.

References L4_CV, and L4_INLINE.

## l4shmc_chunk_try_to_take_for_overwriting()

long l4shmc_chunk_try_to_take_for_overwriting | ( | l4shmc_chunk_t * | chunk | ) |

inline

Try to mark the chunk busy writing after it was ready for reading.

Parameters

  chunk | chunk to mark busy writing.

This function is used by the producer to overwrite a message if the consumer did not read the message within an expected time. This function can only be used if the consumer uses l4shmc_chunk_try_to_take_for_reading() before reading the chunk.

Return values

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

References L4_CV, and L4_INLINE.

## l4shmc_chunk_try_to_take_for_writing()

long l4shmc_chunk_try_to_take_for_writing | ( | l4shmc_chunk_t * | chunk | ) |

inline

Try to mark chunk busy writing.

This function is actually an alias for l4shmc_chunk_try_to_take().

Parameters

  chunk | chunk to mark busy writing.

Return values

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

References L4_CV, and L4_INLINE.

## l4shmc_is_chunk_clear()

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

inline

Check whether chunk is free.

Parameters

  chunk | Chunk to check.

Return values

  !=0 | Chunk is clear.
  0 | Chunk is not clear.

References L4_CV, and L4_INLINE.