Bug Summary

File:/home/joel/rtems-4.11-work/build/rtems/c/src/../../cpukit/score/src/corebarrierrelease.c
Location:line 61, column 12
Description:Although the value stored to 'the_thread' is used in the enclosing expression, the value is never actually read from 'the_thread'

Annotated Source Code

1/*
2 * SuperCore Barrier Handler
3 *
4 * DESCRIPTION:
5 *
6 * This package is part of the implementation of the SuperCore Barrier Handler.
7 *
8 * COPYRIGHT (c) 1989-2006.
9 * On-Line Applications Research Corporation (OAR).
10 *
11 * The license and distribution terms for this file may be
12 * found in the file LICENSE in this distribution or at
13 * http://www.rtems.com/license/LICENSE.
14 *
15 * $Id: corebarrierrelease.c,v 1.3 2008/12/31 03:21:34 ralf Exp $
16 */
17
18#if HAVE_CONFIG_H1
19#include "config.h"
20#endif
21
22#include <rtems/system.h>
23#include <rtems/score/isr.h>
24#include <rtems/score/corebarrier.h>
25#include <rtems/score/states.h>
26#include <rtems/score/thread.h>
27#include <rtems/score/threadq.h>
28
29/*PAGE
30 *
31 * _CORE_barrier_Release
32 *
33 * Input parameters:
34 * the_barrier - the barrier to be flushed
35 * id - id of the object for a remote unblock
36 * api_barrier_mp_support - api dependent MP support actions
37 *
38 * Output parameters:
39 * CORE_BARRIER_STATUS_SUCCESSFUL - if successful
40 * core error code - if unsuccessful
41 *
42 * Output parameters:
43 * returns number of threads unblocked
44 */
45
46uint32_t _CORE_barrier_Release(
47 CORE_barrier_Control *the_barrier,
48#if defined(RTEMS_MULTIPROCESSING)
49 Objects_Id id,
50 CORE_barrier_API_mp_support_callout api_barrier_mp_support
51#else
52 Objects_Id id __attribute__((unused)),
53 CORE_barrier_API_mp_support_callout api_barrier_mp_support __attribute__((unused))
54#endif
55)
56{
57 Thread_Control *the_thread;
58 uint32_t count;
59
60 count = 0;
61 while ( (the_thread = _Thread_queue_Dequeue(&the_barrier->Wait_queue)) ) {
Although the value stored to 'the_thread' is used in the enclosing expression, the value is never actually read from 'the_thread'
62#if defined(RTEMS_MULTIPROCESSING)
63 if ( !_Objects_Is_local_id( the_thread->Object.id ) )
64 (*api_barrier_mp_support) ( the_thread, id );
65#endif
66 count++;
67 }
68 the_barrier->number_of_waiting_threads = 0;
69 return count;
70}