From 1241b0d90412ab90fb0f7caba0acce083f05271c Mon Sep 17 00:00:00 2001 From: Franklin Shan <37760924+wolfdan666@users.noreply.github.com> Date: Mon, 11 Apr 2022 17:33:07 +0800 Subject: [PATCH] [UPDATE] fix c struct compile error solve this error. make it the same as bthread.h --- src/bthread/unstable.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bthread/unstable.h b/src/bthread/unstable.h index ee0fa631bf..dadf9c0469 100644 --- a/src/bthread/unstable.h +++ b/src/bthread/unstable.h @@ -46,7 +46,7 @@ extern int bthread_about_to_quit(); // Run `on_timer(arg)' at or after real-time `abstime'. Put identifier of the // timer into *id. // Return 0 on success, errno otherwise. -extern int bthread_timer_add(bthread_timer_t* id, timespec abstime, +extern int bthread_timer_add(bthread_timer_t* id, struct timespec abstime, void (*on_timer)(void*), void* arg); // Unschedule the timer associated with `id'. @@ -65,7 +65,7 @@ extern int bthread_fd_wait(int fd, unsigned events); // or CLOCK_REALTIME reached `abstime' if abstime is not NULL. // Returns 0 on success, -1 otherwise and errno is set. extern int bthread_fd_timedwait(int fd, unsigned epoll_events, - const timespec* abstime); + const struct timespec* abstime); // Close file descriptor `fd' and wake up all threads waiting on it. // User should call this function instead of close(2) if bthread_fd_wait, @@ -76,7 +76,7 @@ extern int bthread_fd_timedwait(int fd, unsigned epoll_events, extern int bthread_close(int fd); // Replacement of connect(2) in bthreads. -extern int bthread_connect(int sockfd, const sockaddr* serv_addr, +extern int bthread_connect(int sockfd, const struct sockaddr* serv_addr, socklen_t addrlen); // Add a startup function that each pthread worker will run at the beginning