Rename pthread::running to pthread::valid throughout.

* thread.h: (pthread::suspend_all_except_self): New static method.
(pthread::resume_all): Ditto.
(pthread::suspend_except_self): New method.
(pthread::resume): Ditto.
* thread.cc (pthread::suspend_except_self): Implement.
(pthread::resume): Ditto.
This commit is contained in:
Thomas Pfaff
2003-10-31 20:42:56 +00:00
parent d3f6bd13cb
commit c6e0f665bc
3 changed files with 46 additions and 7 deletions

View File

@ -456,7 +456,7 @@ public:
void *(*function) (void *);
void *arg;
void *return_ptr;
bool running;
bool valid;
bool suspended;
int cancelstate, canceltype;
HANDLE cancel_event;
@ -521,12 +521,25 @@ public:
threads.for_each (&pthread::_fixup_after_fork);
}
static void suspend_all_except_self ()
{
threads.for_each (&pthread::suspend_except_self);
}
static void resume_all ()
{
threads.for_each (&pthread::resume);
}
private:
static List<pthread> threads;
DWORD thread_id;
__pthread_cleanup_handler *cleanup_stack;
pthread_mutex mutex;
void suspend_except_self ();
void resume ();
void _fixup_after_fork ();
void pop_all_cleanup_handlers (void);