2000-12-19 Joel Sherrill <joel@OARcorp.com>

* src/pthreadgetschedparam.c: Do not set output parameters if
	the pointers are NULL.
This commit is contained in:
Joel Sherrill
2000-12-19 16:42:15 +00:00
parent da8d470c45
commit 8f4bddd9c0
4 changed files with 24 additions and 8 deletions

View File

@@ -1,3 +1,8 @@
2000-12-19 Joel Sherrill <joel@OARcorp.com>
* src/pthreadgetschedparam.c: Do not set output parameters if
the pointers are NULL.
2000-12-06 Joel Sherrill <joel@OARcorp.com> 2000-12-06 Joel Sherrill <joel@OARcorp.com>
* src/pthreadgetcpuclockid.c: Add include of <rtems/system.h> to * src/pthreadgetcpuclockid.c: Add include of <rtems/system.h> to

View File

@@ -40,10 +40,13 @@ int pthread_getschedparam(
return ESRCH; return ESRCH;
case OBJECTS_LOCAL: case OBJECTS_LOCAL:
api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api = the_thread->API_Extensions[ THREAD_API_POSIX ];
*policy = api->schedpolicy; if ( policy )
*param = api->schedparam; *policy = api->schedpolicy;
param->sched_priority = if ( param ) {
_POSIX_Priority_From_core( the_thread->current_priority ); *param = api->schedparam;
param->sched_priority =
_POSIX_Priority_From_core( the_thread->current_priority );
}
_Thread_Enable_dispatch(); _Thread_Enable_dispatch();
return 0; return 0;
} }

View File

@@ -1,3 +1,8 @@
2000-12-19 Joel Sherrill <joel@OARcorp.com>
* src/pthreadgetschedparam.c: Do not set output parameters if
the pointers are NULL.
2000-12-06 Joel Sherrill <joel@OARcorp.com> 2000-12-06 Joel Sherrill <joel@OARcorp.com>
* src/pthreadgetcpuclockid.c: Add include of <rtems/system.h> to * src/pthreadgetcpuclockid.c: Add include of <rtems/system.h> to

View File

@@ -40,10 +40,13 @@ int pthread_getschedparam(
return ESRCH; return ESRCH;
case OBJECTS_LOCAL: case OBJECTS_LOCAL:
api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api = the_thread->API_Extensions[ THREAD_API_POSIX ];
*policy = api->schedpolicy; if ( policy )
*param = api->schedparam; *policy = api->schedpolicy;
param->sched_priority = if ( param ) {
_POSIX_Priority_From_core( the_thread->current_priority ); *param = api->schedparam;
param->sched_priority =
_POSIX_Priority_From_core( the_thread->current_priority );
}
_Thread_Enable_dispatch(); _Thread_Enable_dispatch();
return 0; return 0;
} }