mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-08-23 04:01:35 +08:00
rtems: Use allocator mutex for timer server
The allocator mutex is recursive and already used for the task creation in rtems_timer_initiate_server(). Just use this mutex instead of the once mutex to serialize the initialization. This avoids a dependency on condition variables which are not used here.
This commit is contained in:
@@ -24,7 +24,6 @@
|
||||
#include <rtems.h>
|
||||
#include <rtems/rtems/timerimpl.h>
|
||||
#include <rtems/rtems/tasksimpl.h>
|
||||
#include <rtems/score/onceimpl.h>
|
||||
#include <rtems/score/todimpl.h>
|
||||
|
||||
static Timer_server_Control _Timer_server_Default;
|
||||
@@ -225,11 +224,10 @@ rtems_status_code rtems_timer_initiate_server(
|
||||
)
|
||||
{
|
||||
rtems_status_code status;
|
||||
Thread_Life_state thread_life_state;
|
||||
|
||||
thread_life_state = _Once_Lock();
|
||||
_Objects_Allocator_lock();
|
||||
status = _Timer_server_Initiate( priority, stack_size, attribute_set );
|
||||
_Once_Unlock( thread_life_state );
|
||||
_Objects_Allocator_unlock();
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user