Changeset 05e2a7ad in mainline for generic/include


Ignore:
Timestamp:
2005-12-07T13:32:31Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
839470f
Parents:
253f8590
Message:

Add comments describing locking rules for some locks.
Cleanup.

Location:
generic/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • generic/include/proc/thread.h

    r253f8590 r05e2a7ad  
    6565        link_t threads_link;                    /**< Link to the list of all threads. */
    6666       
    67         /* items below are protected by lock */
     67        /** Lock protecting thread structure.
     68         *
     69         * Protects the whole thread structure except list links above.
     70         * Must be acquired before T.lock for each T of type task_t.
     71         *
     72         */
    6873        spinlock_t lock;
    6974
     
    110115};
    111116
    112 extern spinlock_t threads_lock;                 /**< Lock protecting threads_head list. */
     117/** Thread list lock.
     118 *
     119 * This lock protects all link_t structures chained in threads_head.
     120 * Must be acquired before T.lock for each T of type thread_t.
     121 *
     122 */
     123extern spinlock_t threads_lock;
     124
    113125extern link_t threads_head;                     /**< List of all threads in the system. */
    114126
  • generic/include/synch/waitq.h

    r253f8590 r05e2a7ad  
    3939#define WAKEUP_ALL      1
    4040
     41/** Wait queue structure. */
    4142struct waitq {
     43
     44        /** Lock protecting wait queue structure.
     45         *
     46         * Must be acquired before T.lock for each T of type thread_t.
     47         */
    4248        spinlock_t lock;
     49
    4350        int missed_wakeups;     /**< Number of waitq_wakeup() calls that didn't find a thread to wake up. */
    4451        link_t head;            /**< List of sleeping threads for wich there was no missed_wakeup. */
     
    5259extern void waitq_initialize(waitq_t *wq);
    5360extern int waitq_sleep_timeout(waitq_t *wq, __u32 usec, int nonblocking);
    54 extern void waitq_wakeup(waitq_t *wq, int all);
    55 extern void _waitq_wakeup_unsafe(waitq_t *wq, int all);
     61extern void waitq_wakeup(waitq_t *wq, bool all);
     62extern void _waitq_wakeup_unsafe(waitq_t *wq, bool all);
    5663
    5764#endif
Note: See TracChangeset for help on using the changeset viewer.