[v3,15/16] eal/windows: disable lock check on alarm code

Message ID 20230404124840.1898-16-david.marchand@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series Enable lock annotations on most libraries and drivers |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

David Marchand April 4, 2023, 12:48 p.m. UTC
  This code uses locks to implement synchronisation between two threads.
There seems nothing wrong with it, just silence the clang lock check.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/eal/windows/eal_alarm.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Tyler Retzlaff April 4, 2023, 4:08 p.m. UTC | #1
On Tue, Apr 04, 2023 at 02:48:39PM +0200, David Marchand wrote:
> This code uses locks to implement synchronisation between two threads.
> There seems nothing wrong with it, just silence the clang lock check.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
  
Dmitry Kozlyuk April 4, 2023, 9:02 p.m. UTC | #2
On Tue, Apr 4, 2023 at 3:49 PM David Marchand <david.marchand@redhat.com> wrote:
>
> This code uses locks to implement synchronisation between two threads.
> There seems nothing wrong with it, just silence the clang lock check.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>

Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
  

Patch

diff --git a/lib/eal/windows/eal_alarm.c b/lib/eal/windows/eal_alarm.c
index 48203a2870..34b52380ce 100644
--- a/lib/eal/windows/eal_alarm.c
+++ b/lib/eal/windows/eal_alarm.c
@@ -224,6 +224,7 @@  struct intr_task {
 
 static void
 intr_thread_entry(void *arg)
+	__rte_no_thread_safety_analysis
 {
 	struct intr_task *task = arg;
 	task->func(task->arg);
@@ -232,6 +233,7 @@  intr_thread_entry(void *arg)
 
 static int
 intr_thread_exec_sync(void (*func)(void *arg), void *arg)
+	__rte_no_thread_safety_analysis
 {
 	struct intr_task task;
 	int ret;