diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2005-08-05 20:14:41 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2005-08-05 20:14:41 +0400 |
commit | 7d7e7a21b13a722a6f6d23d6b7424dbc26d44534 (patch) | |
tree | b5d50d655dc1a686d1421c26b8f1895ae7d8b10a /winsup/cygwin | |
parent | c8f07ce787b7706bebf7edd304c6a0cafa8fa310 (diff) |
* thread.cc (pthread::create(3 args)): Make bool.
(pthread_null::create): Ditto.
(pthread::create(4 args)): Check return of inner create rather than
calling is_good_object().
* thread.h: Ditto.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 8 | ||||
-rw-r--r-- | winsup/cygwin/thread.cc | 14 | ||||
-rw-r--r-- | winsup/cygwin/thread.h | 4 |
3 files changed, 19 insertions, 7 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index d28b9ac6a..b52ceefd3 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,11 @@ +2005-08-05 Michael Gorse <mgorse@alum.wpi.edu> + + * thread.cc (pthread::create(3 args)): Make bool. + (pthread_null::create): Ditto. + (pthread::create(4 args)): Check return of inner create rather than + calling is_good_object(). + * thread.h: Ditto. + 2005-08-05 Vaclav Haisman <v.haisman@sh.cvut.cz> * fhandler_tty.cc (fhandler_tty_slave::tcflush): Return either 0 or -1. diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc index 03bebb1a3..095682022 100644 --- a/winsup/cygwin/thread.cc +++ b/winsup/cygwin/thread.cc @@ -491,13 +491,15 @@ pthread::precreate (pthread_attr *newattr) magic = 0; } -void +bool pthread::create (void *(*func) (void *), pthread_attr *newattr, void *threadarg) { + bool retval; + precreate (newattr); if (!magic) - return; + return false; function = func; arg = threadarg; @@ -517,7 +519,9 @@ pthread::create (void *(*func) (void *), pthread_attr *newattr, while (!cygtls) low_priority_sleep (0); } + retval = magic; mutex.unlock (); + return retval; } void @@ -1993,8 +1997,7 @@ pthread::create (pthread_t *thread, const pthread_attr_t *attr, return EINVAL; *thread = new pthread (); - (*thread)->create (start_routine, attr ? *attr : NULL, arg); - if (!is_good_object (thread)) + if (!(*thread)->create (start_routine, attr ? *attr : NULL, arg)) { delete (*thread); *thread = NULL; @@ -3274,9 +3277,10 @@ pthread_null::~pthread_null () { } -void +bool pthread_null::create (void *(*)(void *), pthread_attr *, void *) { + return true; } void diff --git a/winsup/cygwin/thread.h b/winsup/cygwin/thread.h index 7fa61984e..c15ded478 100644 --- a/winsup/cygwin/thread.h +++ b/winsup/cygwin/thread.h @@ -380,7 +380,7 @@ public: HANDLE cancel_event; pthread_t joiner; - virtual void create (void *(*)(void *), pthread_attr *, void *); + virtual bool create (void *(*)(void *), pthread_attr *, void *); pthread (); virtual ~pthread (); @@ -473,7 +473,7 @@ class pthread_null : public pthread /* From pthread These should never get called * as the ojbect is not verifyable */ - void create (void *(*)(void *), pthread_attr *, void *); + bool create (void *(*)(void *), pthread_attr *, void *); void exit (void *value_ptr) __attribute__ ((noreturn)); int cancel (); void testcancel (); |