Skip to content

Instantly share code, notes, and snippets.

View r-lyeh-archived's full-sized avatar

r-lyeh-archived

View GitHub Profile
@jrandom
jrandom / Pool.h
Last active December 27, 2021 23:54
C++11/14 Thread Pool
//
// Pool.h
//
#ifndef Tools_Thread_Pool_h
#define Tools_Thread_Pool_h
// ================================================================================ Standard Includes
// Standard Includes
#include <stdio.h>
#include <string.h>
enum jstates {JFAILED, JNXT, JSEP, JUP, JDWN, JQUP, JQDWN, JESC, JUNESC, JBARE, JUNBARE, JUTF8_2,
JUTF8_3, JUTF8_4, JUTF8_N, JSTATE_CNT};
enum jtype {JEOS,JERR,JTSEP,JOBJB,JOBJE,JARRB,JARRE,JNUM,JSTR,JTRUE,JFALSE,JNULL};
struct jtok {int type, len; const char *str;};
struct jctx {const unsigned char *tbl; const char *cur, *end;};
static const unsigned char jtbl[256] = {