source: rtems/cpukit/libcsupport/src/assocthreadstatestostring.c @ e366f77

5
Last change on this file since e366f77 was e366f77, checked in by Sebastian Huber <sebastian.huber@…>, on 01/31/17 at 07:08:24

score: Add _Thread_queue_Object_name

Add the special thread queue name _Thread_queue_Object_name to mark
thread queues embedded in an object with identifier. Using the special
thread state STATES_THREAD_QUEUE_WITH_IDENTIFIER is not reliable for
this purpose since the thread wait information and thread state are
protected by different SMP locks in separate critical sections. Remove
STATES_THREAD_QUEUE_WITH_IDENTIFIER.

Add and use _Thread_queue_Object_initialize().

Update #2858.

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/*
2 * Copyright (c) 2016 embedded brains GmbH.
3 *
4 * The license and distribution terms for this file may be
5 * found in the file LICENSE in this distribution or at
6 * http://www.rtems.org/license/LICENSE.
7 */
8
9#if HAVE_CONFIG_H
10#include "config.h"
11#endif
12
13#include <rtems/assoc.h>
14#include <rtems/score/statesimpl.h>
15
16static const rtems_assoc_32_pair state_pairs[] = {
17  { STATES_WAITING_FOR_MUTEX,              "MTX" },
18  { STATES_WAITING_FOR_SEMAPHORE,          "SEM" },
19  { STATES_WAITING_FOR_EVENT,              "EV" },
20  { STATES_WAITING_FOR_SYSTEM_EVENT,       "SYSEV" },
21  { STATES_WAITING_FOR_MESSAGE,            "MSG" },
22  { STATES_WAITING_FOR_CONDITION_VARIABLE, "CV" },
23  { STATES_WAITING_FOR_FUTEX,              "FTX" },
24  { STATES_WAITING_FOR_BSD_WAKEUP,         "WK" },
25  { STATES_WAITING_FOR_TIME,               "TIME" },
26  { STATES_WAITING_FOR_PERIOD,             "PER" },
27  { STATES_WAITING_FOR_SIGNAL,             "SIG" },
28  { STATES_WAITING_FOR_BARRIER,            "BAR" },
29  { STATES_WAITING_FOR_RWLOCK,             "RW" },
30  { STATES_WAITING_FOR_JOIN_AT_EXIT,       "JATX" },
31  { STATES_WAITING_FOR_JOIN,               "JOIN" },
32  { STATES_SUSPENDED,                      "SUSP" },
33  { STATES_WAITING_FOR_SEGMENT,            "SEG" },
34  { STATES_LIFE_IS_CHANGING,               "LIFE" },
35  { STATES_DEBUGGER,                       "DBG" },
36  { STATES_INTERRUPTIBLE_BY_SIGNAL,        "IS" },
37  { STATES_WAITING_FOR_RPC_REPLY,          "RPC" },
38  { STATES_ZOMBIE,                         "ZOMBI" },
39  { STATES_DORMANT,                        "DORM" }
40};
41
42size_t rtems_assoc_thread_states_to_string(
43  uint32_t  states,
44  char     *buffer,
45  size_t    buffer_size
46)
47{
48  return rtems_assoc_32_to_string(
49    states,
50    buffer,
51    buffer_size,
52    state_pairs,
53    RTEMS_ARRAY_SIZE( state_pairs ),
54    ":",
55    "READY"
56  );
57}
Note: See TracBrowser for help on using the repository browser.