From 959a1722faec6b30510c788c49dcb4b7cb96d1e0 Mon Sep 17 00:00:00 2001 From: Mystery Man Date: Fri, 20 Feb 2004 00:03:26 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'V10_0_21mdk'. --- mdk-stage1/dietlibc/libpthread/pthread_create.c | 81 ------------------------- 1 file changed, 81 deletions(-) delete mode 100644 mdk-stage1/dietlibc/libpthread/pthread_create.c (limited to 'mdk-stage1/dietlibc/libpthread/pthread_create.c') diff --git a/mdk-stage1/dietlibc/libpthread/pthread_create.c b/mdk-stage1/dietlibc/libpthread/pthread_create.c deleted file mode 100644 index 714c2bf4b..000000000 --- a/mdk-stage1/dietlibc/libpthread/pthread_create.c +++ /dev/null @@ -1,81 +0,0 @@ -#include -#include -#include - -#include -#include "thread_internal.h" - -int pthread_create (pthread_t *thread, const pthread_attr_t *attr, - void *(*start_routine) (void *), void *arg) -{ - int ret=0; - _pthread_descr td; - pthread_attr_t default_attr; - - __THREAD_INIT(); - - if (start_routine==0) { - return EINVAL; - } - - td = __thread_get_free(); - - if (td) { - td->go.__spinlock=PTHREAD_SPIN_LOCKED; - if (!(attr)) { - pthread_attr_init(&default_attr); - attr=&default_attr; - } - - if ((td->policy!=SCHED_OTHER)&&(td->priority==0)) { - return EINVAL; - } - - if (attr->__inheritsched==PTHREAD_INHERIT_SCHED) { - _pthread_descr this = __thread_self(); - td->policy = this->policy; - td->priority = this->priority; - } else { - td->policy = attr->__schedpolicy; - td->priority = attr->__schedparam.sched_priority; - } - - td->func = start_routine; - td->arg = arg; - - td->detached = attr->__detachstate; - - td->stack_size = attr->__stacksize; - - if (!(attr->__stackaddr)) { - char *stack=(char*)malloc(td->stack_size); - if (!(stack)) { - return EINVAL; - } - td->stack_begin = stack; -#ifdef __parisc__ - td->stack_addr = stack; -#else - td->stack_addr = stack+td->stack_size; -#endif - } else { - td->stack_begin = 0; - td->stack_addr = attr->__stackaddr; - } - - ret = signal_manager_thread(td); - - if (ret>1) - *thread=ret; - else { - ++td->exited; /* mark as exited */ - __thread_cleanup(td); - if (ret<0) return (*(__errno_location())); - return EAGAIN; - } - } - else - return EAGAIN; - - return 0; -} -- cgit v1.2.1