2002-09-21 Robert Collins <rbtcollins@hotmail.com>

* thread.cc: Change verifyable_object_isvalid calls with
        PTHREAD_MUTEX_MAGIC and PTHREAD_KEY_MAGIC and PTHREAD_ATTR_MAGIC to
        ::isGoodObject() calls throughout.
        (MTinterface::Init): Remove dead code.
        (pthread_attr::isGoodObject): Implement.
        (pthread_key::isGoodObject): Implement.
        (pthread_mutex::isGoodObject): Implement.
        (pthread_mutex::isGoodInitializerOrObject): Implement.
        (pthread::isGoodObject): Update signature.
        * thread.h (pthread_key::isGoodObject): Declare.
        (pthread_attr::isGoodObject): Ditto.
        (pthread_mutex::isGoodObject): Ditto.
        (pthread_mutex::isGoodInitializerOrObject): Ditto.
        (pthread::isGoodObject): Change to a const parameter for const
        correctness.
        (pthread_mutexattr::isGoodObject): Declare.
        (pthread_condattr::isGoodObject): Ditto.
        (pthread_cond::isGoodObject): Ditto.
        (semaphore::isGoodObject): Ditto.
This commit is contained in:
Robert Collins
2002-09-20 22:34:05 +00:00
parent 1e0e64c9d8
commit 4e2822f160
3 changed files with 99 additions and 61 deletions

View File

@ -176,6 +176,7 @@ verifyable_object_state verifyable_object_isvalid (void const *, long, void *);
class pthread_key:public verifyable_object
{
public:
static bool isGoodObject (pthread_key_t const *);
DWORD dwTlsIndex;
void *fork_buf;
@ -228,6 +229,7 @@ private:
class pthread_attr:public verifyable_object
{
public:
static bool isGoodObject(pthread_attr_t const *);
int joinable;
int contentionscope;
int inheritsched;
@ -241,6 +243,7 @@ public:
class pthread_mutexattr:public verifyable_object
{
public:
static bool isGoodObject(pthread_mutexattr_t const *);
int pshared;
int mutextype;
pthread_mutexattr ();
@ -250,6 +253,8 @@ public:
class pthread_mutex:public verifyable_object
{
public:
static bool isGoodObject(pthread_mutex_t const *);
static bool isGoodInitializerOrObject(pthread_mutex_t const *);
CRITICAL_SECTION criticalsection;
HANDLE win32_obj_id;
LONG condwaits;
@ -290,7 +295,7 @@ public:
virtual ~pthread ();
static void initMainThread(pthread *, HANDLE);
static bool isGoodObject(pthread_t *);
static bool isGoodObject(pthread_t const *);
static void atforkprepare();
static void atforkparent();
static void atforkchild();
@ -356,6 +361,7 @@ class pthreadNull : public pthread
class pthread_condattr:public verifyable_object
{
public:
static bool isGoodObject(pthread_condattr_t *);
int shared;
pthread_condattr ();
@ -365,6 +371,7 @@ public:
class pthread_cond:public verifyable_object
{
public:
static bool isGoodObject(pthread_cond_t *);
int shared;
LONG waiting;
LONG ExitingWait;
@ -393,6 +400,7 @@ public:
class semaphore:public verifyable_object
{
public:
static bool isGoodObject(semaphore **);
HANDLE win32_obj_id;
class semaphore * next;
int shared;