(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 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.
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;
while (!cygtls)
low_priority_sleep (0);
}
+ retval = magic;
mutex.unlock ();
+ return retval;
}
void
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;
{
}
-void
+bool
pthread_null::create (void *(*)(void *), pthread_attr *, void *)
{
+ return true;
}
void
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 ();
/* 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 ();