Sha256: 74398150678fa8cb3ae2ca371c9064cc42b06db85b5b81f7e5deb491c85a6c48

Contents?: true

Size: 932 Bytes

Versions: 64

Compression:

Stored size: 932 Bytes

Contents

#include <debase_internals.h>
static locked_thread_t *locked_head = NULL;
static locked_thread_t *locked_tail = NULL;

extern int
is_in_locked(VALUE thread)
{
  locked_thread_t *node;

  if(!locked_head) return 0;

  for(node = locked_head; node != locked_tail; node = node->next)
  {
    if(node->thread == thread) return 1;
  }
  return 0;
}

extern void
add_to_locked(VALUE thread)
{
  locked_thread_t *node;

  if(is_in_locked(thread)) return;

  node = ALLOC(locked_thread_t);
  node->thread = thread;
  node->next = NULL;
  if(locked_tail)
    locked_tail->next = node;
  locked_tail = node;
  if(!locked_head)
    locked_head = node;
}

extern VALUE
remove_from_locked()
{
  VALUE thread;
  locked_thread_t *node;

  if(locked_head == NULL)
    return Qnil;

  node = locked_head;
  locked_head = locked_head->next;
  if(locked_tail == node)
    locked_tail = NULL;
  thread = node->thread;
  xfree(node);
  return thread;
}

Version data entries

64 entries across 53 versions & 3 rubygems

Version Path
debase-0.2.7 ext/locker.c
debase-0.2.6 ext/locker.c
avalara_sdk-24.2.29 vendor/bundle/ruby/2.7.0/gems/debase-0.2.4.1/ext/locker.c
avalara_sdk-24.2.29 vendor/bundle/ruby/2.7.0/gems/debase-0.2.5.beta2/ext/locker.c
tdiary-5.2.0 vendor/bundle/ruby/2.7.0/gems/debase-0.2.4.1/ext/locker.c
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/debase-0.2.4.1/ext/locker.c
tdiary-5.1.7 vendor/bundle/ruby/2.7.0/gems/debase-0.2.4.1/ext/locker.c
tdiary-5.1.7 vendor/bundle/ruby/3.0.0/gems/debase-0.2.4.1/ext/locker.c
tdiary-5.1.6 vendor/bundle/ruby/3.0.0/gems/debase-0.2.4.1/ext/locker.c
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/debase-0.2.4.1/ext/locker.c
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/debase-0.2.4.1/ext/locker.c
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/2.7.0/gems/debase-0.2.4.1/ext/locker.c
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/debase-0.2.4.1/ext/locker.c
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/debase-0.2.5.beta1/ext/locker.c
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/debase-0.2.5.beta1/ext/locker.c
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/debase-0.2.4.1/ext/locker.c
tdiary-5.1.5 vendor/bundle/ruby/2.7.0/gems/debase-0.2.4.1/ext/locker.c
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/debase-0.2.4.1/ext/locker.c
debase-0.2.5.beta2 ext/locker.c
tdiary-5.1.4 vendor/bundle/ruby/2.7.0/gems/debase-0.2.4.1/ext/locker.c