Changeset dc747e3 in mainline for generic/src/proc


Ignore:
Timestamp:
2005-12-15T10:27:59Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7dd2561
Parents:
3fc03fd
Message:

Add SPINLOCK_DECLARE and SPINLOCK_INITIALIZE macros.
SPINLOCK_DECLARE is to be used instead of direct spinlock_t declarations
in dynamically allocated structures on which spinlock_initialize() is called after
their creation.
SPINLOCK_INITIALIZE is to be used instead of direct spinlock_t declarations
of global spinlocks. It declares and initializes the spinlock.
Moreover, both macros are empty on UP so that -Wall warnings about unused structures
get supressed.

Location:
generic/src/proc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • generic/src/proc/task.c

    r3fc03fd rdc747e3  
    3737#include <list.h>
    3838
    39 spinlock_t tasks_lock;
     39SPINLOCK_INITIALIZE(tasks_lock);
    4040link_t tasks_head;
    4141
     
    4949{
    5050        TASK = NULL;
    51         spinlock_initialize(&tasks_lock, "tasks_lock");
    5251        list_initialize(&tasks_head);
    5352}
  • generic/src/proc/thread.c

    r3fc03fd rdc747e3  
    5555char *thread_states[] = {"Invalid", "Running", "Sleeping", "Ready", "Entering", "Exiting"}; /**< Thread states */
    5656
    57 spinlock_t threads_lock;        /**< Lock protecting threads_head list. For locking rules, see declaration thereof. */
    58 link_t threads_head;            /**< List of all threads. */
    59 
    60 static spinlock_t tidlock;
     57SPINLOCK_INITIALIZE(threads_lock);      /**< Lock protecting threads_head list. For locking rules, see declaration thereof. */
     58link_t threads_head;                    /**< List of all threads. */
     59
     60SPINLOCK_INITIALIZE(tidlock);
    6161__u32 last_tid = 0;
    6262
     
    9797        THREAD = NULL;
    9898        nrdy = 0;
    99         spinlock_initialize(&threads_lock, "threads_lock");
    10099        list_initialize(&threads_head);
    101100}
Note: See TracChangeset for help on using the changeset viewer.