Second round of changes. Splitted thread.c into thread.c, team.c and scheduler.c. First kernel-only get_team_info and get_next_team_info implementation.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@569 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -345,6 +345,15 @@ thread_id find_thread(const char *);
|
||||
|
||||
status_t snooze(bigtime_t);
|
||||
|
||||
status_t _get_team_info(team_id id, team_info *info, size_t size);
|
||||
status_t _get_next_team_info(int32 *cookie, team_info *info, size_t size);
|
||||
|
||||
#define get_team_info(id, info) \
|
||||
_get_team_info((id), (info), sizeof(*(info)))
|
||||
|
||||
#define get_next_team_info(cookie, info) \
|
||||
_get_next_sem_info((cookie), (info), sizeof(*(info)))
|
||||
|
||||
/** @} */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -46,6 +46,14 @@ extern spinlock_t thread_spinlock;
|
||||
#define GRAB_THREAD_LOCK() acquire_spinlock(&thread_spinlock)
|
||||
#define RELEASE_THREAD_LOCK() release_spinlock(&thread_spinlock)
|
||||
|
||||
extern struct thread_queue dead_q;
|
||||
|
||||
extern spinlock_t team_spinlock;
|
||||
// NOTE: TEAM lock can be held over a THREAD lock acquisition,
|
||||
// but not the other way (to avoid deadlock)
|
||||
#define GRAB_TEAM_LOCK() acquire_spinlock(&team_spinlock)
|
||||
#define RELEASE_TEAM_LOCK() release_spinlock(&team_spinlock)
|
||||
|
||||
enum {
|
||||
THREAD_STATE_READY = 0, // ready to run
|
||||
THREAD_STATE_RUNNING, // running right now somewhere
|
||||
|
||||
Reference in New Issue
Block a user