diff options
| -rw-r--r-- | ChangeLog | 9 | ||||
| -rw-r--r-- | cleanup.c | 19 | ||||
| -rw-r--r-- | create.c | 20 | ||||
| -rw-r--r-- | private.c | 34 | 
4 files changed, 46 insertions, 36 deletions
@@ -1,3 +1,12 @@ +Wed Jul 29 11:39:03 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au> + +	* cleanup.c (_pthread_handler_push): Same as below. + +	* create.c (pthread_create): Same as below. + +	* private.c (_pthread_new_thread): Rename "new" to "new_thread". +	Since when has a C programmer been required to know C++? +  Tue Jul 28 14:04:29 1998  Ross Johnson  <rpj@swan.canberra.edu.au>  	* implement.h: Add _PTHREAD_VALID macro. @@ -17,36 +17,37 @@ _pthread_handler_push(int stack,  {    /* Place the new handler into the list so that handlers are       popped off in the order given by poporder. */ -  _pthread_handler_node_t * new; +  _pthread_handler_node_t * new_thread;    _pthread_handler_node_t * next;    _pthread_handler_node_t ** stacktop;    stacktop = _PTHREAD_STACK(stack); -  new = (_pthread_handler_node_t *) malloc(sizeof(_pthread_handler_node_t)); +  new_thread =  +    (_pthread_handler_node_t *) malloc(sizeof(_pthread_handler_node_t)); -  if (new == NULL) +  if (new_thread == NULL)      {        return ENOMEM;      } -  new->routine = routine; -  new->arg = arg; +  new_thread->routine = routine; +  new_thread->arg = arg;    if (poporder == _PTHREAD_HANDLER_POP_LIFO)      {        /* Add the new node to the start of the list. */ -      new->next = *stacktop; +      new_thread->next = *stacktop;        *stacktop = next;      }    else      {        /* Add the new node to the end of the list. */ -      new->next = NULL; +      new_thread->next = NULL;        if (*stacktop == NULL)  	{ -	  *stacktop = new; +	  *stacktop = new_thread;  	}        else  	{ @@ -57,7 +58,7 @@ _pthread_handler_push(int stack,  	      next = next->next;  	    } -	  next = new; +	  next = new_thread;  	}      }    return 0; @@ -56,21 +56,21 @@ pthread_create(pthread_t *thread,    void *   security = NULL;    DWORD  threadID;    pthread_attr_t * attr_copy; -  pthread_t new; +  pthread_t new_thread;    /* Success unless otherwise set. */    int ret;    /* CRITICAL SECTION */    pthread_mutex_lock(&_pthread_table_mutex); -  ret = _pthread_new_thread(&new); +  ret = _pthread_new_thread(&new_thread);    pthread_mutex_lock(&_pthread_table_mutex);    /* END CRITICAL SECTION */    if (ret == 0)      { -      attr_copy = &(new->attr); +      attr_copy = &(new_thread->attr);        /* Map given attributes otherwise just use default values. */        if (attr != NULL)  @@ -89,8 +89,8 @@ pthread_create(pthread_t *thread,  	}        /* We call a generic wrapper which then calls the start routine. */ -      new->call.routine = start_routine; -      new->call.arg = arg; +      new_thread->call.routine = start_routine; +      new_thread->call.arg = arg;        /* Start running, not suspended. */        flags = 0; @@ -98,7 +98,7 @@ pthread_create(pthread_t *thread,        handle = (HANDLE) _beginthreadex(security,  				       attr_copy->stacksize,  				       _pthread_start_call, -				       (void *) new, +				       (void *) new_thread,  				       flags,  				       &threadID); @@ -115,9 +115,9 @@ pthread_create(pthread_t *thread,    if (ret == 0)      {        /* Let the caller know the thread handle. */ -      new->win32handle = handle; -      new->ptstatus = _PTHREAD_INUSE; -      *thread = new; +      new_thread->win32handle = handle; +      new_thread->ptstatus = _PTHREAD_INUSE; +      *thread = new_thread;      }    else      { @@ -125,7 +125,7 @@ pthread_create(pthread_t *thread,        pthread_mutex_lock(&_pthread_table_mutex);        /* Remove the failed thread entry. */ -      _pthread_delete_thread(new); +      _pthread_delete_thread(new_thread);        pthread_mutex_lock(&_pthread_table_mutex);        /* END CRITICAL SECTION */ @@ -99,7 +99,7 @@  int  _pthread_new_thread(pthread_t * thread)  { -  pthread_t new; +  pthread_t new_thread;    if (_pthread_reuse_top == -1)      { @@ -109,28 +109,28 @@ _pthread_new_thread(pthread_t * thread)  	}        else  	{ -	  new = _pthread_virgin[_pthread_virgin_next++]; +	  new_thread = _pthread_virgin[_pthread_virgin_next++];  	}      }    else      { -      new = _pthread_reuse[_pthread_reuse_top--]; +      new_thread = _pthread_reuse[_pthread_reuse_top--];      } -  new->win32handle = NULL; -  new->ptstatus = _PTHREAD_NEW; -  pthread_attr_init(&(new->attr)); -  new->joinvalueptr = NULL; -  new->cancelstate = PTHREAD_CANCEL_ENABLE; -  new->canceltype = PTHREAD_CANCEL_DEFERRED; -  new->cancel_pending = FALSE; -  new->cleanupstack = NULL; -  new->destructorstack = NULL; -  new->forkpreparestack = NULL; -  new->forkparentstack = NULL; -  new->forkchildstack = NULL; - -  *thread = new; +  new_thread->win32handle = NULL; +  new_thread->ptstatus = _PTHREAD_NEW; +  pthread_attr_init(&(new_thread->attr)); +  new_thread->joinvalueptr = NULL; +  new_thread->cancelstate = PTHREAD_CANCEL_ENABLE; +  new_thread->canceltype = PTHREAD_CANCEL_DEFERRED; +  new_thread->cancel_pending = FALSE; +  new_thread->cleanupstack = NULL; +  new_thread->destructorstack = NULL; +  new_thread->forkpreparestack = NULL; +  new_thread->forkparentstack = NULL; +  new_thread->forkchildstack = NULL; + +  *thread = new_thread;    return 0;  }  | 
