Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion uthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ int uthread_create(schedule_t &schedule,Fun func,void *arg)
getcontext(&(t->ctx));

t->ctx.uc_stack.ss_sp = t->stack;
t->ctx.uc_stack.ss_size = DEFAULT_STACK_SZIE;
t->ctx.uc_stack.ss_size = DEFAULT_STACK_SIZE;
t->ctx.uc_stack.ss_flags = 0;
t->ctx.uc_link = &(schedule.main);
schedule.running_thread = id;
Expand Down
4 changes: 2 additions & 2 deletions uthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <ucontext.h>
#include <vector>

#define DEFAULT_STACK_SZIE (1024*128)
#define DEFAULT_STACK_SIZE (1024*128)
#define MAX_UTHREAD_SIZE 1024

enum ThreadState{FREE,RUNNABLE,RUNNING,SUSPEND};
Expand All @@ -34,7 +34,7 @@ typedef struct uthread_t
Fun func;
void *arg;
enum ThreadState state;
char stack[DEFAULT_STACK_SZIE];
char stack[DEFAULT_STACK_SIZE];
}uthread_t;

typedef struct schedule_t
Expand Down