Skip to content

Commit 49e02cd

Browse files
committed
fix segfault when exiting the program.
1 parent 025adee commit 49e02cd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/lib.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
extern int pthread_mutexattr_settype(pthread_mutexattr_t *, int);
2323
typedef void *(*pfunc_t)(void *);
2424
extern pthread_t threads[];
25-
extern int newthread(pfunc_t thread_func);
25+
extern pthread_t newthread(pfunc_t thread_func);
2626

2727
#define gettid() syscall(SYS_gettid)
2828

shell/main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ extern void tcp_timer(void);
1919
*/
2020
pthread_t threads[4];
2121

22-
int newthread(pfunc_t thread_func)
22+
pthread_t newthread(pfunc_t thread_func)
2323
{
2424
pthread_t tid;
2525
if (pthread_create(&tid, NULL, thread_func, NULL))

0 commit comments

Comments
 (0)