/**************************************************************************/
/* */
/* Copyright (c) Microsoft Corporation. All rights reserved. */
/* */
/* This software is licensed under the Microsoft Software License */
/* Terms for Microsoft Azure RTOS. Full text of the license can be */
/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
/* and in the root directory of this software. */
/* */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Thread */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
/* Include necessary system files. */
#include "tx_api.h"
#include "tx_trace.h"
#include "tx_timer.h"
#include "tx_thread.h"
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _tx_thread_system_suspend PORTABLE C */
/* 6.1 */
/* */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function suspends the specified thread and changes the thread */
/* state to the value specified. Note: delayed suspension processing */
/* is handled outside of this routine. */
/* */
/* INPUT */
/* */
/* thread_ptr Pointer to thread to suspend */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* _tx_thread_system_return Return to system */
/* _tx_thread_system_preempt_check System preemption check */
/* _tx_timer_system_activate Activate timer for timeout */
/* */
/* CALLED BY */
/* */
/* _tx_thread_priority_change Thread priority change */
/* _tx_thread_shell_entry Thread shell function */
/* _tx_thread_sleep Thread sleep */
/* _tx_thread_suspend Application thread suspend */
/* _tx_thread_terminate Thread terminate */
/* Other ThreadX Components */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* */
/**************************************************************************/
VOID _tx_thread_system_suspend(TX_THREAD *thread_ptr)
#ifndef TX_NOT_INTERRUPTABLE
{
TX_INTERRUPT_SAVE_AREA
UINT priority;
UINT base_priority;
ULONG priority_map;
ULONG priority_bit;
ULONG combined_flags;
TX_THREAD *ready_next;
TX_THREAD *ready_previous;
TX_THREAD *current_thread;
#if TX_MAX_PRIORITIES > 32
UINT map_index;
#endif
#ifndef TX_NO_TIMER
ULONG timeout;
#endif
#ifdef TX_ENABLE_EVENT_TRACE
TX_TRACE_BUFFER_ENTRY *entry_ptr;
ULONG time_stamp = ((ULONG) 0);
#endif
/* Pickup thread pointer. */
TX_THREAD_GET_CURRENT(current_thread)
#ifdef TX_ENABLE_STACK_CHECKING
/* Check this thread's stack. */
TX_THREAD_STACK_CHECK(thread_ptr)
#endif
/* Lockout interrupts while the thread is being suspended. */
TX_DISABLE
#ifndef TX_NO_TIMER
/* Is the current thread suspending? */
if (thread_ptr == current_thread)
{
/* Pickup the wait option. */
timeout = thread_ptr -> tx_thread_timer.tx_timer_internal_remaining_ticks;
/* Determine if an activation is needed. */
if (timeout != TX_NO_WAIT)
{
/* Make sure the suspension is not a wait-forever. */
if (timeout != TX_WAIT_FOREVER)
{
/* Activate the thread timer with the timeout value setup in the caller. */
_tx_timer_system_activate(&(thread_ptr -> tx_thread_timer));
}
}
/* Yes, reset time slice for current thread. */
_tx_timer_time_slice = thread_ptr -> tx_thread_new_time_slice;
}
#endif
/* Decrease the preempt disabled count. */
_tx_thread_preempt_disable--;
#ifdef TX_THREAD_ENABLE_PERFORMANCE_INFO
/* Increment the thread's suspend count. */
thread_ptr -> tx_thread_performance_suspend_count++;
/* Increment the total number of thread suspensions. */
_tx_thread_performance_suspend_count++;
#endif
/* Check to make sure the thread suspending flag is still set. If not, it
has already been resumed. */
if (thread_ptr -> tx_thread_suspending == TX_TRUE)
{
/* Thread state change. */
TX_THREAD_STATE_CHANGE(thread_ptr, thread_ptr -> tx_thread_state)
/* Log the thread status change. */
TX_EL_THREAD_STATUS_CHANGE_INSERT(thread_ptr, thread_ptr -> tx_thread_state)
#ifdef TX_ENABLE_EVENT_TRACE
/* If trace is enabled, save the current event pointer. */
entry_ptr = _tx_trace_buffer_current_ptr;
#endif
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
STM32F103+Azure threadx RTOS 简单任务 (237个子文件)
keilkilll.bat 399B
tx_thread_system_suspend.c 45KB
tx_thread_system_resume.c 40KB
tx_misra.c 40KB
tx_thread_suspend.c 32KB
tx_mutex_put.c 29KB
tx_event_flags_set.c 26KB
tx_thread_resume.c 23KB
tx_timer_expiration_process.c 22KB
tx_timer_thread_entry.c 21KB
tx_queue_receive.c 20KB
tx_trace_enable.c 19KB
tx_thread_initialize.c 19KB
tx_mutex_get.c 18KB
tx_queue_front_send.c 17KB
tx_queue_send.c 17KB
tx_byte_allocate.c 17KB
tx_event_flags_get.c 16KB
tx_thread_create.c 16KB
tx_byte_pool_search.c 16KB
tx_block_allocate.c 16KB
tx_byte_release.c 16KB
tx_mutex_priority_change.c 15KB
tx_mutex_cleanup.c 14KB
tx_thread_priority_change.c 13KB
tx_trace_object_register.c 13KB
tx_thread_preemption_change.c 13KB
txe_thread_create.c 12KB
tx_thread_performance_info_get.c 12KB
tx_event_flags_cleanup.c 12KB
tx_thread_terminate.c 12KB
tx_timer_initialize.c 11KB
tx_thread_performance_system_info_get.c 11KB
tx_mutex_prioritize.c 11KB
tx_timer_deactivate.c 11KB
tx_semaphore_prioritize.c 11KB
tx_block_pool_prioritize.c 11KB
tx_byte_pool_prioritize.c 11KB
tx_queue_prioritize.c 11KB
tx_timer_info_get.c 11KB
tx_queue_cleanup.c 10KB
tx_semaphore_cleanup.c 10KB
tx_block_pool_create.c 10KB
tx_block_pool_cleanup.c 10KB
tx_byte_pool_cleanup.c 10KB
tx_byte_pool_create.c 10KB
tx_semaphore_get.c 10KB
tx_byte_pool_performance_info_get.c 10KB
tx_semaphore_ceiling_put.c 10KB
tx_thread_wait_abort.c 10KB
txe_timer_create.c 10KB
tx_mutex_delete.c 10KB
txe_block_pool_create.c 9KB
txe_queue_create.c 9KB
tx_queue_performance_info_get.c 9KB
tx_semaphore_put.c 9KB
tx_mutex_performance_info_get.c 9KB
tx_byte_pool_delete.c 9KB
tx_block_release.c 9KB
tx_event_flags_delete.c 9KB
txe_byte_pool_create.c 9KB
tx_semaphore_delete.c 9KB
tx_byte_pool_performance_system_info_get.c 9KB
tx_block_pool_delete.c 9KB
tx_queue_flush.c 9KB
txe_mutex_create.c 9KB
tx_timer_performance_info_get.c 9KB
tx_thread_stack_analyze.c 9KB
tx_queue_delete.c 9KB
tx_thread_time_slice.c 8KB
tx_timer_system_activate.c 8KB
txe_semaphore_create.c 8KB
txe_event_flags_create.c 8KB
tx_event_flags_performance_info_get.c 8KB
tx_queue_create.c 8KB
tx_thread_shell_entry.c 8KB
txe_byte_allocate.c 8KB
tx_queue_performance_system_info_get.c 8KB
tx_block_pool_performance_info_get.c 8KB
tx_timer_create.c 8KB
tx_semaphore_performance_info_get.c 8KB
tx_mutex_performance_system_info_get.c 8KB
tx_thread_sleep.c 8KB
tx_initialize_kernel_enter.c 8KB
txe_event_flags_get.c 8KB
tx_timer_performance_system_info_get.c 8KB
tx_thread_delete.c 8KB
tx_thread_relinquish.c 8KB
tx_initialize_high_level.c 7KB
tx_thread_reset.c 7KB
tx_thread_info_get.c 7KB
tx_block_pool_performance_system_info_get.c 7KB
tx_event_flags_performance_system_info_get.c 7KB
tx_semaphore_create.c 7KB
tx_thread_timeout.c 7KB
tx_event_flags_create.c 7KB
tx_semaphore_performance_system_info_get.c 7KB
txe_mutex_get.c 7KB
txe_block_allocate.c 7KB
txe_queue_receive.c 7KB
共 237 条
- 1
- 2
- 3
资源评论
u010179747
- 粉丝: 6
- 资源: 46
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 【java毕业设计】记账管理系统源码(ssm+mysql+说明文档+LW).zip
- playwright抓取所有歌手的头像
- 机器学习(预测模型):从基因表达数据中预测患者的生存情况
- 【java毕业设计】基于Word自动出题系统源码(ssm+mysql+说明文档+LW).zip
- 基于数学建模探究树叶形态与树冠结构关系及其应用-估算树叶总量方法
- 树叶形状、分布与树枝结构关系及其质量估算模型研究
- 长河游览最优计划制定-考虑游客野营体验与行程灵活性的模型分析
- 飞控固件版本ArduCopter-APM-2.0-Firmware-3.2.1
- 渗透测试前置网络探测工具.zip
- 【java毕业设计】网上招聘系统的设计与实现源码(ssm+mysql+说明文档).zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功