0
  /   ˆ{‹„„-i[D<†ªoZƒ›Ù«Ä553_‘I|¥‰ÓMdœv ©ƒ†ü+=ÃÂ )    ‹      Í•QoÚ0Çßû)<?ì.Êž:Riheš¦iªœØ!V“8²Röéç¬*•Ön‰ÏÎÿ|÷;;¶÷ÆŸ_gWèãâzŒfŸ?ŒGC„ _ÚC á×:MÇ¸š`„ccò>@Y–Í²Ý”j	‹9Ä&M: �¡i2Ã09óª1r†¼˜Sf[äaNFã÷HFda´`Üú­50¾!×•mx
a^T�‘PiI¿Í$ã�Çk-BšÔ½êå@ÊS©ÖÝè"¨½=¨CÙà°�î’­«¤Ü×IÀÆÙ Ó`“Ge*â™­h"–Ù ™câ‰t‰´
D(3AB³»æRDÑÄð·ÑpúÝêÀÄ•7ñ(Š�øýp0¹˜|L&4åÐÇ5×Vs‰É˜jƒRÉD$8;*¾©Å7âÇñ	ýZãs*‘!³½,â!j(�SËzn	bu¨ª%ìOÕ áoÅ˜]Î¯&4¯KÂª)öÙýõåÄdf…™A¾P<4vpËZ~›:¿ØuÑ–D‰el0A¨�U>?’	ãê° ÇÐw°˜ì¬ÃL¤ÖrZÝ†ë6Ürßõ�.Bÿƒ+®6[ë†Ö9r�~»÷¢Ev—É2;„°»ü)ˆ[ZØ©”ø/šýÐiXN·ßêÅ²çñ§€õ é8O¯Ò+ã|ekLêöåN<a{[x°¹¬<¨oÐŸPw‘ñ¤    6   ˆl–Ãa¾”Ò~êq@µpOÜjbÑ¿�þB7›YÇ�¬”­ùÇƒq×ŸÆÅÄÃ …    /*
   +----------------------------------------------------------------------+
   | Thread Safe Resource Manager                                         |
   +----------------------------------------------------------------------+
   | Copyright (c) 1999-2011, Andi Gutmans, Sascha Schumann, Zeev Suraski |
   | This source file is subject to the TSRM license, that is bundled     |
   | with this package in the file LICENSE                                |
   +----------------------------------------------------------------------+
   | Authors:  Zeev Suraski <zeev@php.net>                                |
   +----------------------------------------------------------------------+
*/

#ifndef TSRM_H
#define TSRM_H

#if !defined(__CYGWIN__) && defined(WIN32)
# define TSRM_WIN32
# include "Zend/zend_config.w32.h"
#else
# include "main/php_config.h"
#endif

#include "main/php_stdint.h"

#ifdef TSRM_WIN32
#	ifdef TSRM_EXPORTS
#		define TSRM_API __declspec(dllexport)
#	else
#		define TSRM_API __declspec(dllimport)
#	endif
#elif defined(__GNUC__) && __GNUC__ >= 4
#	define TSRM_API __attribute__ ((visibility("default")))
#else
#	define TSRM_API
#endif

typedef intptr_t tsrm_intptr_t;
typedef uintptr_t tsrm_uintptr_t;

/* Only compile multi-threading functions if we're in ZTS mode */
#ifdef ZTS

#ifdef TSRM_WIN32
# ifndef TSRM_INCLUDE_FULL_WINDOWS_HEADERS
#  define WIN32_LEAN_AND_MEAN
# endif
# include <windows.h>
# include <shellapi.h>
#elif defined(GNUPTH)
# include <pth.h>
#elif defined(PTHREADS)
# include <pthread.h>
#elif defined(TSRM_ST)
# include <st.h>
#endif

#if SIZEOF_SIZE_T == 4
# define TSRM_ALIGNED_SIZE(size) \
	(((size) + INT32_C(15)) & ~INT32_C(15))
#else
# define TSRM_ALIGNED_SIZE(size) \
	(((size) + INT64_C(15)) & ~INT64_C(15))
#endif

typedef int ts_rsrc_id;

/* Define THREAD_T and MUTEX_T */
#ifdef TSRM_WIN32
# define THREAD_T DWORD
# define MUTEX_T CRITICAL_SECTION *
#elif defined(GNUPTH)
# define THREAD_T pth_t
# define MUTEX_T pth_mutex_t *
#elif defined(PTHREADS)
# define THREAD_T pthread_t
# define MUTEX_T pthread_mutex_t *
#elif defined(TSRM_ST)
# define THREAD_T st_thread_t
# define MUTEX_T st_mutex_t
#endif

#include <signal.h>

typedef void (*ts_allocate_ctor)(void *);
typedef void (*ts_allocate_dtor)(void *);

#define THREAD_HASH_OF(thr,ts)  (unsigned long)thr%(unsigned long)ts

#ifdef __cplusplus
extern "C" {
#endif

/* startup/shutdown */
TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_level, char *debug_filename);
TSRM_API void tsrm_shutdown(void);

/* environ lock API */
TSRM_API void tsrm_env_lock();
TSRM_API void tsrm_env_unlock();

/* allocates a new thread-safe-resource id */
TSRM_API ts_rsrc_id ts_allocate_id(ts_rsrc_id *rsrc_id, size_t size, ts_allocate_ctor ctor, ts_allocate_dtor dtor);

/* Fast resource in reserved (pre-allocated) space */
TSRM_API void tsrm_reserve(size_t size);
TSRM_API ts_rsrc_id ts_allocate_fast_id(ts_rsrc_id *rsrc_id, size_t *offset, size_t size, ts_allocate_ctor ctor, ts_allocate_dtor dtor);

/* fetches the requested resource for the current thread */
TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id);
#define ts_resource(id)			ts_resource_ex(id, NULL)

/* frees all resources allocated for the current thread */
TSRM_API void ts_free_thread(void);

/* deallocates all occurrences of a given id */
TSRM_API void ts_free_id(ts_rsrc_id id);


/* Debug