Sha256: 46c166456bac182f87e0ff5b37ecb44162b7fce39f973d3dfa0167a70e616d25

Contents?: true

Size: 944 Bytes

Versions: 12

Compression:

Stored size: 944 Bytes

Contents

#ifndef MYSQL2_CLIENT_H
#define MYSQL2_CLIENT_H

/*
 * partial emulation of the 1.9 rb_thread_blocking_region under 1.8,
 * this is enough for dealing with blocking I/O functions in the
 * presence of threads.
 */
#ifndef HAVE_RB_THREAD_BLOCKING_REGION

#include <rubysig.h>
#define RUBY_UBF_IO ((rb_unblock_function_t *)-1)
typedef void rb_unblock_function_t(void *);
typedef VALUE rb_blocking_function_t(void *);
static VALUE
rb_thread_blocking_region(
  rb_blocking_function_t *func, void *data1,
  RB_MYSQL_UNUSED rb_unblock_function_t *ubf,
  RB_MYSQL_UNUSED void *data2)
{
  VALUE rv;

  TRAP_BEG;
  rv = func(data1);
  TRAP_END;

  return rv;
}

#endif /* ! HAVE_RB_THREAD_BLOCKING_REGION */

void init_mysql2_client();

typedef struct {
  VALUE encoding;
  VALUE active_thread; /* rb_thread_current() or Qnil */
  int reconnect_enabled;
  int active;
  int connected;
  int initialized;
  MYSQL *client;
} mysql_client_wrapper;

#endif

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
mysql2-0.3.12b6 ext/mysql2/client.h
mysql2-0.2.19b6 ext/mysql2/client.h
mysql2-0.2.19b5 ext/mysql2/client.h
mysql2-0.3.12b5 ext/mysql2/client.h
mysql2-0.2.19b4 ext/mysql2/client.h
mysql2-0.3.12b4 ext/mysql2/client.h
mysql2-0.2.19b3 ext/mysql2/client.h
mysql2-0.3.12b3 ext/mysql2/client.h
mysql2-0.3.12b2 ext/mysql2/client.h
mysql2-0.2.19b2 ext/mysql2/client.h
mysql2-0.3.12b1 ext/mysql2/client.h
mysql2-0.2.19b1 ext/mysql2/client.h