From 0d9c205610f99e2e5255fe2f6237989cae9dcb24 Mon Sep 17 00:00:00 2001 From: Vitaly Pavlov Date: Fri, 11 Oct 2024 00:31:49 +0000 Subject: [PATCH] fix pthread issue --- lib/ff_api.h | 2 ++ lib/ff_api.symlist | 4 +++- lib/ff_compat.c | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/ff_api.h b/lib/ff_api.h index e547007ea..cf4661218 100644 --- a/lib/ff_api.h +++ b/lib/ff_api.h @@ -51,6 +51,8 @@ struct linux_sockaddr { typedef int (*loop_func_t)(void *arg); +extern __thread struct thread *pcurthread; + int ff_init(int argc, char * const argv[]); void ff_run(loop_func_t loop, void *arg); diff --git a/lib/ff_api.symlist b/lib/ff_api.symlist index d988e0763..eebe5618e 100755 --- a/lib/ff_api.symlist +++ b/lib/ff_api.symlist @@ -5,6 +5,7 @@ ff_setsockopt ff_getsockopt ff_ioctl ff_close +ff_compat ff_read ff_readv ff_write @@ -59,4 +60,5 @@ ff_zc_mbuf_write ff_zc_mbuf_read ff_get_traffic ff_pthread_create -ff_pthread_join \ No newline at end of file +ff_pthread_join +pcurthread \ No newline at end of file diff --git a/lib/ff_compat.c b/lib/ff_compat.c index 2e3810845..bb22f355e 100644 --- a/lib/ff_compat.c +++ b/lib/ff_compat.c @@ -55,7 +55,7 @@ TAILQ_HEAD(prisonlist, prison); -__thread struct thread *pcurthread; +__thread struct thread *pcurthread = NULL; struct cdev; struct vnode *rootvnode;