|
|
@ -1,19 +1,28 @@
|
|
|
|
|
|
|
|
// Something is not idempotent with this or some other include.
|
|
|
|
|
|
|
|
// If placed in Local Includes, error is triggered that memset was implicitly declared
|
|
|
|
#include <runtime.h>
|
|
|
|
#include <runtime.h>
|
|
|
|
#include <sys/mman.h>
|
|
|
|
|
|
|
|
#include <types.h>
|
|
|
|
/***************************
|
|
|
|
#include <sandbox.h>
|
|
|
|
* External Includes *
|
|
|
|
|
|
|
|
**************************/
|
|
|
|
|
|
|
|
#include <pthread.h> // POSIX Threads
|
|
|
|
|
|
|
|
#include <signal.h> // POSIX Signals
|
|
|
|
|
|
|
|
#include <sched.h> // Wasmception. Included as submodule
|
|
|
|
|
|
|
|
#include <sys/mman.h> // Wasmception. Included as submodule
|
|
|
|
|
|
|
|
#include <uv.h> // Libub
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***************************
|
|
|
|
|
|
|
|
* Local Includes *
|
|
|
|
|
|
|
|
**************************/
|
|
|
|
#include <arch/context.h>
|
|
|
|
#include <arch/context.h>
|
|
|
|
|
|
|
|
#include <current_sandbox.h>
|
|
|
|
|
|
|
|
#include <http_parser_settings.h>
|
|
|
|
#include <module.h>
|
|
|
|
#include <module.h>
|
|
|
|
#include <signal.h>
|
|
|
|
#include <sandbox.h>
|
|
|
|
#include <pthread.h>
|
|
|
|
#include <sandbox_request.h>
|
|
|
|
#include <sched.h>
|
|
|
|
#include <software_interrupt.h>
|
|
|
|
#include <softint.h>
|
|
|
|
#include <types.h>
|
|
|
|
#include <uv.h>
|
|
|
|
|
|
|
|
#include <util.h>
|
|
|
|
#include <util.h>
|
|
|
|
#include <http_parser_settings.h>
|
|
|
|
|
|
|
|
#include <current_sandbox.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "sandbox_request.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***************************
|
|
|
|
/***************************
|
|
|
|
* Shared Process State *
|
|
|
|
* Shared Process State *
|
|
|
@ -44,8 +53,8 @@ runtime__initialize(void)
|
|
|
|
deque_init_sandbox(runtime__global_deque, SBOX_MAX_REQS);
|
|
|
|
deque_init_sandbox(runtime__global_deque, SBOX_MAX_REQS);
|
|
|
|
|
|
|
|
|
|
|
|
// Mask Signals
|
|
|
|
// Mask Signals
|
|
|
|
software_interrupt__mask(SIGUSR1);
|
|
|
|
software_interrupt__mask_signal(SIGUSR1);
|
|
|
|
software_interrupt__mask(SIGALRM);
|
|
|
|
software_interrupt__mask_signal(SIGALRM);
|
|
|
|
|
|
|
|
|
|
|
|
// Initialize http_parser_settings global
|
|
|
|
// Initialize http_parser_settings global
|
|
|
|
http_parser_settings__initialize(&runtime__http_parser_settings);
|
|
|
|
http_parser_settings__initialize(&runtime__http_parser_settings);
|
|
|
@ -417,8 +426,8 @@ worker_thread__main(void *return_code)
|
|
|
|
software_interrupt__is_disabled = 0;
|
|
|
|
software_interrupt__is_disabled = 0;
|
|
|
|
worker_thread__next_context = NULL;
|
|
|
|
worker_thread__next_context = NULL;
|
|
|
|
#ifndef PREEMPT_DISABLE
|
|
|
|
#ifndef PREEMPT_DISABLE
|
|
|
|
software_interrupt__unmask(SIGALRM);
|
|
|
|
software_interrupt__unmask_signal(SIGALRM);
|
|
|
|
software_interrupt__unmask(SIGUSR1);
|
|
|
|
software_interrupt__unmask_signal(SIGUSR1);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
uv_loop_init(&worker_thread__uvio_handle);
|
|
|
|
uv_loop_init(&worker_thread__uvio_handle);
|
|
|
|
worker_thread__is_in_callback = 0;
|
|
|
|
worker_thread__is_in_callback = 0;
|
|
|
|