Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2005-08-05 20:14:41 +0400
committerCorinna Vinschen <corinna@vinschen.de>2005-08-05 20:14:41 +0400
commit7d7e7a21b13a722a6f6d23d6b7424dbc26d44534 (patch)
treeb5d50d655dc1a686d1421c26b8f1895ae7d8b10a /winsup/cygwin/thread.cc
parentc8f07ce787b7706bebf7edd304c6a0cafa8fa310 (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/thread.cc')
-rw-r--r--winsup/cygwin/thread.cc14
1 files changed, 9 insertions, 5 deletions
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