Permalink
Browse files

drop lthread_t* from the function paramters passed to lthread_create

  • Loading branch information...
halayli committed May 31, 2012
1 parent 45a0a54 commit d04501df8346175230884a4565deaeb369893d70
Showing with 8 additions and 4 deletions.
  1. +1 −1 src/Makefile.am
  2. +1 −1 src/lthread.c
  3. +3 −1 src/lthread.h
  4. +3 −1 src/lthread_int.h
View
@@ -2,4 +2,4 @@ lib_LTLIBRARIES = liblthread.la
liblthread_la_SOURCES = lthread.c lthread_socket.c lthread_sched.c lthread_compute.c rbtree.c time_utils.c poller.c
include_HEADERS = lthread.h
AM_LDFLAGS = -pthread
-AM_CFLAGS = -Wall -Werror
+AM_CFLAGS = -Wall -Werror -g
View
@@ -117,7 +117,7 @@ _exec(void *lt)
#if defined(__llvm__) && defined(__x86_64__)
__asm__ ("movq 16(%%rbp), %[lt]" : [lt] "=r" (lt));
#endif
- ((lthread_t *)lt)->fun(lt, ((lthread_t *)lt)->arg);
+ ((lthread_t *)lt)->fun(((lthread_t *)lt)->arg);
((lthread_t *)lt)->state |= bit(LT_EXITED);
_lthread_yield(lt);
View
@@ -46,7 +46,9 @@ typedef struct _lthread_cond lthread_cond_t;
char *lthread_summary();
-int lthread_create(lthread_t **new_lt, void *fun, void *arg);
+typedef void (*lthread_func)(void *);
+
+int lthread_create(lthread_t **new_lt, lthread_func, void *arg);
void lthread_destroy(lthread_t *lt);
void lthread_run(void);
int lthread_join(lthread_t *lt, void **ptr, uint64_t timeout);
View
@@ -72,6 +72,8 @@ typedef struct _sched_node_l _sched_node_l_t;
LIST_HEAD(_lthread_l, _lthread);
typedef struct _lthread_l lthread_l_t;
+typedef void (*lthread_func)(void *);
+
typedef enum {
LT_READ,
LT_WRITE,
@@ -115,7 +117,7 @@ struct _sched_node {
struct _lthread {
struct _cpu_state st;
- void (*fun)(lthread_t *lt, void *);
+ lthread_func fun;
void *arg;
void *data;
size_t stack_size;

0 comments on commit d04501d

Please sign in to comment.