summaryrefslogtreecommitdiff
path: root/Zend/zend.h
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2011-06-02 21:16:50 +0000
committerIlia Alshanetsky <iliaa@php.net>2011-06-02 21:16:50 +0000
commit939875133a2c389d621a9999a8ede3ddbc9b6637 (patch)
tree110835541d96f1f8cbb147c36ae6d7d023790933 /Zend/zend.h
parente87534b01715d8da78f96f72f6127de67664b2a0 (diff)
downloadphp-git-939875133a2c389d621a9999a8ede3ddbc9b6637.tar.gz
Zend Signal Handling (see RFC: https://wiki.php.net/rfc/zendsignals)
This needs to go into 5.4 as well, but will wait for Pierre to review win32 situation # Patch by Lucas Nealan, Arnaud Le Blanc, Brian Shire & Ilia Alshanetsky
Diffstat (limited to 'Zend/zend.h')
-rw-r--r--Zend/zend.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/Zend/zend.h b/Zend/zend.h
index a80526c0eb..7305b4b281 100644
--- a/Zend/zend.h
+++ b/Zend/zend.h
@@ -531,8 +531,10 @@ typedef struct _zend_utility_functions {
int (*write_function)(const char *str, uint str_length);
FILE *(*fopen_function)(const char *filename, char **opened_path TSRMLS_DC);
void (*message_handler)(long message, void *data TSRMLS_DC);
+#ifndef ZEND_SIGNALS
void (*block_interruptions)(void);
void (*unblock_interruptions)(void);
+#endif
int (*get_configuration_directive)(const char *name, uint name_length, zval *contents);
void (*ticks_function)(int ticks);
void (*on_timeout)(int seconds TSRMLS_DC);
@@ -678,8 +680,10 @@ BEGIN_EXTERN_C()
extern ZEND_API int (*zend_printf)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
extern ZEND_API zend_write_func_t zend_write;
extern ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path TSRMLS_DC);
+#ifndef ZEND_SIGNALS
extern ZEND_API void (*zend_block_interruptions)(void);
extern ZEND_API void (*zend_unblock_interruptions)(void);
+#endif
extern ZEND_API void (*zend_ticks_function)(int ticks);
extern ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 4, 0);
extern void (*zend_on_timeout)(int seconds TSRMLS_DC);
@@ -702,8 +706,15 @@ END_EXTERN_C()
#define ZEND_UV(name) (zend_uv.name)
+#ifndef ZEND_SIGNALS
#define HANDLE_BLOCK_INTERRUPTIONS() if (zend_block_interruptions) { zend_block_interruptions(); }
#define HANDLE_UNBLOCK_INTERRUPTIONS() if (zend_unblock_interruptions) { zend_unblock_interruptions(); }
+#else
+#include "zend_signal.h"
+
+#define HANDLE_BLOCK_INTERRUPTIONS() SIGG(depth)++;
+#define HANDLE_UNBLOCK_INTERRUPTIONS() if (UNEXPECTED((--SIGG(depth))==SIGG(blocked))) { zend_signal_handler_unblock(TSRMLS_C); }
+#endif
BEGIN_EXTERN_C()
ZEND_API void zend_message_dispatcher(long message, void *data TSRMLS_DC);