forgot to add a file

Original commit message from CVS:
forgot to add a file
This commit is contained in:
Andy Wingo 2002-01-22 01:32:49 +00:00
parent 89627e60d5
commit e395c92f13

View file

@ -0,0 +1,43 @@
/* Linuxthreads - a simple clone()-based implementation of Posix */
/* threads for Linux. */
/* Copyright (C) 1996 Xavier Leroy (Xavier.Leroy@inria.fr) */
/* */
/* This program is free software; you can redistribute it and/or */
/* modify it under the terms of the GNU Library General Public License */
/* as published by the Free Software Foundation; either version 2 */
/* of the License, or (at your option) any later version. */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU Library General Public License for more details. */
/* hacked for use with gstreamer by andy wingo <wingo@pobox.com> */
/* Internal data structures */
#include <sys/types.h> /* _pthread_fastlock */
typedef void * pthread_descr;
/* Global array of thread handles, used for validating a thread id
and retrieving the corresponding thread descriptor. Also used for
mapping the available stack segments. */
extern struct pthread_handle_struct __pthread_handles[PTHREAD_THREADS_MAX];
struct pthread_handle_struct {
struct _pthread_fastlock h_lock; /* Fast lock for sychronized access */
pthread_descr h_descr; /* Thread descriptor or NULL if invalid */
char * h_bottom; /* Lowest address in the stack thread */
};
typedef struct pthread_handle_struct * pthread_handle;
/* Return the handle corresponding to a thread id */
static inline pthread_handle thread_handle(pthread_t id)
{
return &__pthread_handles[id % PTHREAD_THREADS_MAX];
}