Subversion Repositories Kolibri OS

Rev

Rev 1967 | Rev 3391 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1967 Rev 2161
Line 41... Line 41...
41
 * - detects multi-task circular deadlocks and prints out all affected
41
 * - detects multi-task circular deadlocks and prints out all affected
42
 *   locks and tasks (and only those tasks)
42
 *   locks and tasks (and only those tasks)
43
 */
43
 */
44
struct mutex {
44
struct mutex {
45
	/* 1: unlocked, 0: locked, negative: locked, possible waiters */
45
	/* 1: unlocked, 0: locked, negative: locked, possible waiters */
46
	atomic_t		count;
-
 
47
	struct list_head	wait_list;
46
	struct list_head	wait_list;
-
 
47
    atomic_t            count;
48
};
48
};
Line 49... Line 49...
49
 
49
 
50
/*
50
/*
51
 * This is the control structure for tasks blocked on mutex,
51
 * This is the control structure for tasks blocked on mutex,
Line 56... Line 56...
56
    int                *task;
56
    int                *task;
57
};
57
};
Line 58... Line 58...
58
 
58
 
-
 
59
 
59
 
60
#define __MUTEX_INITIALIZER(lockname) \
60
#define __MUTEX_INITIALIZER(lockname) \
61
                { .wait_list = LIST_HEAD_INIT(lockname.wait_list), \
Line 61... Line 62...
61
                { .count = ATOMIC_INIT(1) \
62
                  .count = ATOMIC_INIT(1) \
62
                , .wait_list = LIST_HEAD_INIT(lockname.wait_list) }
63
                }
Line 63... Line 64...
63
 
64