Skip to content

Commit b3f7cfd

Browse files
committed
Now allows arbitrary structure pass from main/user to a thread. User's responsibility to ensure they match!
1 parent e7eab90 commit b3f7cfd

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ codegen/
33
*~
44
contrib/
55
buildinfo.mat
6+
*.zip

stl/stl.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -154,16 +154,16 @@ stl_sleep(double t)
154154

155155

156156
int
157-
stl_thread_create(char *func, arg_t * arg, char *name)
157+
stl_thread_create(char *func, void *arg, char *name)
158158
{
159159
pthread_attr_t attr;
160-
void * (*f)(int32_t);
160+
void * (*f)(void *);
161161
int status;
162162
int slot;
163163
thread *p, *tp = NULL;
164164

165165
// map function name to a pointer
166-
f = (void *(*)(int32_t)) stl_get_functionptr(func);
166+
f = (void *(*)(void *)) stl_get_functionptr(func);
167167
if (f == NULL)
168168
stl_error("thread function named [%s] not found", func);
169169

stl/stl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ char *stl_stralloc(char *s);
1212
void stl_sleep(double t);
1313

1414
// threads
15-
int32_t stl_thread_create(char *func, arg_t * arg, char *name);
15+
int32_t stl_thread_create(char *func, void * arg, char *name);
1616
int32_t stl_thread_join(int32_t slot);
1717
void stl_thread_cancel(int32_t slot);
1818
int32_t stl_thread_self();

0 commit comments

Comments
 (0)