Skip to content

Commit

Permalink
Fixed flag toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
tidwall committed Apr 15, 2024
1 parent a11fd99 commit e7a1b30
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions neco.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ NECO_USEHEAPSTACK // Allocate stacks on the heap using malloc
NECO_NOSIGNALS // Disable signal handling
NECO_NOWORKERS // Disable all worker threads, work will run in coroutine
NECO_USEREADWORKERS // Use read workers, disabled by default
NECO_NOWRITEWORKERS // Disable write workers
NECO_USEWRITEWORKERS // Use write workers, enabled by default on Linux
NECO_NOREADWORKERS // Disable all read workers
NECO_NOWRITEWORKERS // Disable all write workers
*/

// Windows and Webassembly have limited features.
Expand All @@ -56,6 +58,12 @@ NECO_NOWRITEWORKERS // Disable write workers
#define DEF_MAXIOWORKERS 2
#endif

#ifdef __linux__
#ifndef NECO_USEWRITEWORKERS
#define NECO_USEWRITEWORKERS
#endif
#endif

#ifndef NECO_STACKSIZE
#define NECO_STACKSIZE DEF_STACKSIZE
#endif
Expand Down Expand Up @@ -91,6 +99,7 @@ NECO_NOWRITEWORKERS // Disable write workers
#endif
#endif


// The following is only needed when LLCO_NOASM or LLCO_STACKJMP is defined.
// This same block is duplicated in the llco.c block below.
#ifdef _FORTIFY_SOURCE
Expand Down Expand Up @@ -4988,7 +4997,8 @@ static void cowait(int fd, enum evkind kind, int64_t deadline) {
// Networking code
////////////////////////////////////////////////////////////////////////////////

#if !defined(NECO_NOWORKERS) && defined(NECO_USEREADWORKERS)
#if !defined(NECO_NOWORKERS) && defined(NECO_USEREADWORKERS) && \
!defined(NECO_NOREADWORKERS)

struct ioread {
int fd;
Expand Down Expand Up @@ -5150,7 +5160,8 @@ static ssize_t write1(int fd, const void *data, size_t nbytes) {
#define write2 write1
#endif

#if !defined(NECO_NOWORKERS) && !defined(NECO_NOWRITEWORKERS)
#if !defined(NECO_NOWORKERS) && defined(NECO_USEWRITEWORKERS) && \
!defined(NECO_NOWRITEWORKERS)
struct iowrite {
int fd;
const void *data;
Expand Down

0 comments on commit e7a1b30

Please sign in to comment.