Sha256: 5dc8640ffcf02dea72ed3783db1737689dd746a14152c0017bd842c3ff697cbe

Contents?: true

Size: 1.26 KB

Versions: 17

Compression:

Stored size: 1.26 KB

Contents

#ifndef RUNQUEUE_RING_BUFFER_H
#define RUNQUEUE_RING_BUFFER_H

#include "ruby.h"

typedef struct runqueue_entry {
  VALUE fiber;
  VALUE value;
} runqueue_entry;

typedef struct runqueue_ring_buffer {
  runqueue_entry *entries;
  unsigned int size;
  unsigned int count;
  unsigned int head;
  unsigned int tail;
} runqueue_ring_buffer;

void runqueue_ring_buffer_init(runqueue_ring_buffer *buffer);
void runqueue_ring_buffer_free(runqueue_ring_buffer *buffer);
void runqueue_ring_buffer_mark(runqueue_ring_buffer *buffer);
int runqueue_ring_buffer_empty_p(runqueue_ring_buffer *buffer);
void runqueue_ring_buffer_clear(runqueue_ring_buffer *buffer);

runqueue_entry runqueue_ring_buffer_shift(runqueue_ring_buffer *buffer);
void runqueue_ring_buffer_unshift(runqueue_ring_buffer *buffer, VALUE fiber, VALUE value);
void runqueue_ring_buffer_push(runqueue_ring_buffer *buffer, VALUE fiber, VALUE value);

void runqueue_ring_buffer_delete(runqueue_ring_buffer *buffer, VALUE fiber);
int runqueue_ring_buffer_delete_if_not_exception(runqueue_ring_buffer *buffer, VALUE fiber);
int runqueue_ring_buffer_index_of(runqueue_ring_buffer *buffer, VALUE fiber);

void runqueue_ring_buffer_migrate(runqueue_ring_buffer *src, runqueue_ring_buffer *dest, VALUE fiber);

#endif /* RUNQUEUE_RING_BUFFER_H */

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
polyphony-1.6 ext/polyphony/runqueue_ring_buffer.h
polyphony-1.5 ext/polyphony/runqueue_ring_buffer.h
polyphony-1.4 ext/polyphony/runqueue_ring_buffer.h
polyphony-1.3 ext/polyphony/runqueue_ring_buffer.h
polyphony-1.2.1 ext/polyphony/runqueue_ring_buffer.h
polyphony-1.2 ext/polyphony/runqueue_ring_buffer.h
polyphony-1.1.1 ext/polyphony/runqueue_ring_buffer.h
polyphony-1.1 ext/polyphony/runqueue_ring_buffer.h
polyphony-1.0.2 ext/polyphony/runqueue_ring_buffer.h
polyphony-1.0.1 ext/polyphony/runqueue_ring_buffer.h
polyphony-1.0 ext/polyphony/runqueue_ring_buffer.h
polyphony-0.99.6 ext/polyphony/runqueue_ring_buffer.h
polyphony-0.99.5 ext/polyphony/runqueue_ring_buffer.h
polyphony-0.99.4 ext/polyphony/runqueue_ring_buffer.h
polyphony-0.99.3 ext/polyphony/runqueue_ring_buffer.h
polyphony-0.99.2 ext/polyphony/runqueue_ring_buffer.h
polyphony-0.99.1 ext/polyphony/runqueue_ring_buffer.h