projects
/
c11tester.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
libthreads: create header file
[c11tester.git]
/
libthreads.c
diff --git
a/libthreads.c
b/libthreads.c
index 4545ee3640a79a542e1c61f199bd37853c4c9231..5ede8d7eafa5a7cf0e32f740434872c5f9c82987 100644
(file)
--- a/
libthreads.c
+++ b/
libthreads.c
@@
-1,28
+1,13
@@
#include <string.h>
#include <stdlib.h>
#include <ucontext.h>
#include <string.h>
#include <stdlib.h>
#include <ucontext.h>
-#include <stdio.h>
//#define CONFIG_DEBUG
//#define CONFIG_DEBUG
-#ifdef CONFIG_DEBUG
-#define DBG() do { printf("Here: %s, L%d\n", __func__, __LINE__); } while (0)
-#define DEBUG(fmt, ...) printf(fmt, ##__VA_ARGS__)
-#else
-#define DBG()
-#define DEBUG(fmt, ...)
-#endif
+#include "libthreads.h"
#define STACK_SIZE (1024 * 1024)
#define STACK_SIZE (1024 * 1024)
-struct thread {
- void (*start_routine);
- void *arg;
- ucontext_t context;
- void *stack;
- int index;
-};
-
static struct thread *current;
static ucontext_t *cleanup;
static struct thread *current;
static ucontext_t *cleanup;