mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Add task_testcancel()
This commit is contained in:
@@ -52,10 +52,6 @@ ifneq ($(CONFIG_DISABLE_SIGNALS),y)
|
||||
CSRCS += pthread_condtimedwait.c pthread_kill.c pthread_sigmask.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CANCELLATION_POINTS),y)
|
||||
CSRCS += pthread_testcancel.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SMP),y)
|
||||
CSRCS += pthread_setaffinity.c pthread_getaffinity.c
|
||||
endif
|
||||
|
||||
@@ -50,7 +50,7 @@ CSRCS += task_spawn.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CANCELLATION_POINTS),y)
|
||||
CSRCS += task_setcanceltype.c
|
||||
CSRCS += task_setcanceltype.c task_testcancel.c
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_BINFMT_DISABLE),y)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* sched/pthread/pthread_testcancel.c
|
||||
* sched/task/task_testcancel.c
|
||||
*
|
||||
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
@@ -39,28 +39,28 @@
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <pthread.h>
|
||||
#include <sched.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/cancelpt.h>
|
||||
|
||||
#include "sched/sched.h"
|
||||
#include "task/task.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: pthread_testcancel
|
||||
* Name: task_testcancel
|
||||
*
|
||||
* Description:
|
||||
* The pthread_testcancel() function creates a cancellation point in the
|
||||
* calling thread. The pthread_testcancel() function has no effect if
|
||||
* The task_testcancel() function creates a cancellation point in the
|
||||
* calling thread. The task_testcancel() function has no effect if
|
||||
* cancelability is disabled
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void pthread_testcancel(void)
|
||||
void task_testcancel(void)
|
||||
{
|
||||
(void)enter_cancellation_point();
|
||||
leave_cancellation_point();
|
||||
Reference in New Issue
Block a user