mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-13 14:40:22 +00:00
Move the magic field initialisation to a place when it is more magic.
This commit is contained in:
parent
aec0bcdf5b
commit
377aa2cbb6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=35022
@ -60,12 +60,6 @@ _thread_create(pthread_t * thread, const pthread_attr_t * attr,
|
||||
/* Insufficient memory to create a thread: */
|
||||
ret = EAGAIN;
|
||||
} else {
|
||||
/*
|
||||
* Write a magic value to the thread structure to help
|
||||
* identify valid ones:
|
||||
*/
|
||||
new_thread->magic = PTHREAD_MAGIC;
|
||||
|
||||
/* Check if default thread attributes are required: */
|
||||
if (attr == NULL || *attr == NULL) {
|
||||
/* Use the default thread attributes: */
|
||||
@ -92,6 +86,13 @@ _thread_create(pthread_t * thread, const pthread_attr_t * attr,
|
||||
new_thread->stack = stack;
|
||||
new_thread->start_routine = start_routine;
|
||||
new_thread->arg = arg;
|
||||
|
||||
/*
|
||||
* Write a magic value to the thread structure
|
||||
* to help identify valid ones:
|
||||
*/
|
||||
new_thread->magic = PTHREAD_MAGIC;
|
||||
|
||||
if (pattr->suspend == PTHREAD_CREATE_SUSPENDED) {
|
||||
PTHREAD_NEW_STATE(new_thread,PS_SUSPENDED);
|
||||
} else {
|
||||
|
@ -60,12 +60,6 @@ _thread_create(pthread_t * thread, const pthread_attr_t * attr,
|
||||
/* Insufficient memory to create a thread: */
|
||||
ret = EAGAIN;
|
||||
} else {
|
||||
/*
|
||||
* Write a magic value to the thread structure to help
|
||||
* identify valid ones:
|
||||
*/
|
||||
new_thread->magic = PTHREAD_MAGIC;
|
||||
|
||||
/* Check if default thread attributes are required: */
|
||||
if (attr == NULL || *attr == NULL) {
|
||||
/* Use the default thread attributes: */
|
||||
@ -92,6 +86,13 @@ _thread_create(pthread_t * thread, const pthread_attr_t * attr,
|
||||
new_thread->stack = stack;
|
||||
new_thread->start_routine = start_routine;
|
||||
new_thread->arg = arg;
|
||||
|
||||
/*
|
||||
* Write a magic value to the thread structure
|
||||
* to help identify valid ones:
|
||||
*/
|
||||
new_thread->magic = PTHREAD_MAGIC;
|
||||
|
||||
if (pattr->suspend == PTHREAD_CREATE_SUSPENDED) {
|
||||
PTHREAD_NEW_STATE(new_thread,PS_SUSPENDED);
|
||||
} else {
|
||||
|
@ -60,12 +60,6 @@ _thread_create(pthread_t * thread, const pthread_attr_t * attr,
|
||||
/* Insufficient memory to create a thread: */
|
||||
ret = EAGAIN;
|
||||
} else {
|
||||
/*
|
||||
* Write a magic value to the thread structure to help
|
||||
* identify valid ones:
|
||||
*/
|
||||
new_thread->magic = PTHREAD_MAGIC;
|
||||
|
||||
/* Check if default thread attributes are required: */
|
||||
if (attr == NULL || *attr == NULL) {
|
||||
/* Use the default thread attributes: */
|
||||
@ -92,6 +86,13 @@ _thread_create(pthread_t * thread, const pthread_attr_t * attr,
|
||||
new_thread->stack = stack;
|
||||
new_thread->start_routine = start_routine;
|
||||
new_thread->arg = arg;
|
||||
|
||||
/*
|
||||
* Write a magic value to the thread structure
|
||||
* to help identify valid ones:
|
||||
*/
|
||||
new_thread->magic = PTHREAD_MAGIC;
|
||||
|
||||
if (pattr->suspend == PTHREAD_CREATE_SUSPENDED) {
|
||||
PTHREAD_NEW_STATE(new_thread,PS_SUSPENDED);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user