Sha256: 72640c8d6853751c6e7053c178849576e40a5994e0cebc87d51b4226ec229201

Contents?: true

Size: 1.72 KB

Versions: 58

Compression:

Stored size: 1.72 KB

Contents

/*
 * Copyright (c) 2010 Wayne Meissner
 *
 * All rights reserved.
 *
 * This file is part of ruby-ffi.
 *
 * This code is free software: you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License version 3 only, as
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
 * version 3 for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with this work.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef RBFFI_THREAD_H
#define	RBFFI_THREAD_H

#ifndef _MSC_VER
#include <stdbool.h>
#else
typedef int bool;
#define true 1
#define false 0
#endif
#include <ruby.h>
#include "extconf.h"

#ifdef	__cplusplus
extern "C" {
#endif


#ifdef HAVE_RUBY_THREAD_HAS_GVL_P
    extern int ruby_thread_has_gvl_p(void);
# define rbffi_thread_has_gvl_p ruby_thread_has_gvl_p
#else

#ifdef _WIN32
# include <windows.h>
#else
# include <pthread.h>
#endif

typedef struct {
#ifdef _WIN32
    DWORD id;
#else
    pthread_t id;
#endif
    bool valid;
} rbffi_thread_t;

extern rbffi_thread_t rbffi_active_thread;
rbffi_thread_t rbffi_thread_self();
bool rbffi_thread_equal(const rbffi_thread_t* lhs, const rbffi_thread_t* rhs);
bool rbffi_thread_has_gvl_p(void);

#endif
#ifdef HAVE_RB_THREAD_BLOCKING_REGION
# define rbffi_thread_blocking_region rb_thread_blocking_region
#else

VALUE rbffi_thread_blocking_region(VALUE (*func)(void *), void *data1, void (*ubf)(void *), void *data2);

#endif


#ifdef	__cplusplus
}
#endif

#endif	/* RBFFI_THREAD_H */

Version data entries

58 entries across 58 versions & 4 rubygems

Version Path
librarian-puppet-0.9.9 vendor/gems/ruby/1.9.1/gems/ffi-1.3.1/ext/ffi_c/Thread.h
librarian-puppet-0.9.8 vendor/gems/ruby/1.9.1/gems/ffi-1.3.1/ext/ffi_c/Thread.h
ffi-1.3.1-x86-mingw32 ext/ffi_c/Thread.h
ffi-1.3.1 ext/ffi_c/Thread.h
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/ffi-1.2.0/ext/ffi_c/Thread.h
ffi-1.3.0-x86-mingw32 ext/ffi_c/Thread.h
ffi-1.3.0 ext/ffi_c/Thread.h
ffi-1.2.1-x86-mingw32 ext/ffi_c/Thread.h
ffi-1.2.1 ext/ffi_c/Thread.h
ffi-1.2.0-x86-mingw32 ext/ffi_c/Thread.h
ffi-1.2.0 ext/ffi_c/Thread.h
ffi-1.2.0.pre6-x86-mingw32 ext/ffi_c/Thread.h
ffi-1.2.0.pre6 ext/ffi_c/Thread.h
ffi-1.2.0.pre5 ext/ffi_c/Thread.h
ffi-1.2.0.pre4 ext/ffi_c/Thread.h
ffi-1.2.0.pre3-x86-mingw32 ext/ffi_c/Thread.h
ffi-1.2.0.pre3 ext/ffi_c/Thread.h
ffi-1.2.0.pre2-x86-mingw32 ext/ffi_c/Thread.h
ffi-1.2.0.pre2 ext/ffi_c/Thread.h
fragrant-0.0.5 vendor/bundle/ruby/1.9.1/gems/ffi-1.1.5/ext/ffi_c/Thread.h