Add task_testcancel()

This commit is contained in:
Gregory Nutt
2016-12-10 16:34:14 -06:00
parent 50a25c3fde
commit d648f9c8b4
14 changed files with 168 additions and 83 deletions
-4
View File
@@ -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
+1 -1
View File
@@ -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();