X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fthreads%2Fthread.c;h=e31d838da14a3c5012c6f8b5affd582c6885952c;hb=5fbedf1d20c2b2f2dbc8c7ebd64cc7b4812a44bf;hp=fed6b841aded48864edee8307fec6fb6090c87ae;hpb=c9c283cb3e26a5b6d918ee47dcf8efe28522b18d;p=pintos-anon diff --git a/src/threads/thread.c b/src/threads/thread.c index fed6b84..e31d838 100644 --- a/src/threads/thread.c +++ b/src/threads/thread.c @@ -24,11 +24,11 @@ static void idle (void *aux UNUSED); /* Thread function. */ struct kernel_thread_frame { void *eip; /* Return address. */ - void (*function) (void *); /* Function to call. */ + thread_func *function; /* Function to call. */ void *aux; /* Auxiliary data for function. */ }; -static void kernel_thread (void (*function) (void *aux), void *aux); +static void kernel_thread (thread_func *, void *aux); static struct thread *next_thread_to_run (void); static struct thread *new_thread (const char *name); @@ -76,7 +76,7 @@ thread_start (void) semaphore or some other form of synchronization if you need to ensure ordering. */ struct thread * -thread_create (const char *name, void (*function) (void *aux), void *aux) +thread_create (const char *name, thread_func *function, void *aux) { struct thread *t; struct kernel_thread_frame *kf; @@ -263,7 +263,7 @@ idle (void *aux UNUSED) /* Function used as the basis for a kernel thread. */ static void -kernel_thread (void (*function) (void *aux), void *aux) +kernel_thread (thread_func *function, void *aux) { ASSERT (function != NULL);