From 0e5706746b76448b32f939f5339ec20087855c13 Mon Sep 17 00:00:00 2001 From: Marcus Winter Date: Wed, 25 Mar 2015 13:45:46 +0100 Subject: [PATCH] mtapi_cpp: added missing concurrency tags --- mtapi_cpp/include/embb/mtapi/action.h | 1 + mtapi_cpp/include/embb/mtapi/action_attributes.h | 1 + mtapi_cpp/include/embb/mtapi/affinity.h | 6 ++++++ mtapi_cpp/include/embb/mtapi/group.h | 5 +++++ mtapi_cpp/include/embb/mtapi/group_attributes.h | 1 + mtapi_cpp/include/embb/mtapi/job.h | 1 + mtapi_cpp/include/embb/mtapi/node.h | 4 ++++ mtapi_cpp/include/embb/mtapi/node_attributes.h | 10 ++++++++++ mtapi_cpp/include/embb/mtapi/queue.h | 9 +++++++++ mtapi_cpp/include/embb/mtapi/queue_attributes.h | 7 +++++++ mtapi_cpp/include/embb/mtapi/status_exception.h | 1 + mtapi_cpp/include/embb/mtapi/task.h | 1 + mtapi_cpp/include/embb/mtapi/task_attributes.h | 4 ++++ mtapi_cpp/include/embb/mtapi/task_context.h | 1 + 14 files changed, 52 insertions(+) diff --git a/mtapi_cpp/include/embb/mtapi/action.h b/mtapi_cpp/include/embb/mtapi/action.h index fb2a738..763c611 100644 --- a/mtapi_cpp/include/embb/mtapi/action.h +++ b/mtapi_cpp/include/embb/mtapi/action.h @@ -105,6 +105,7 @@ class Action { * Allows for interoperability with the C interface. * * \returns The internal mtapi_action_hndl_t. + * \waitfree */ mtapi_action_hndl_t GetInternal() const { return handle_; diff --git a/mtapi_cpp/include/embb/mtapi/action_attributes.h b/mtapi_cpp/include/embb/mtapi/action_attributes.h index 0a63ad3..ea1ddb0 100644 --- a/mtapi_cpp/include/embb/mtapi/action_attributes.h +++ b/mtapi_cpp/include/embb/mtapi/action_attributes.h @@ -105,6 +105,7 @@ public: * Allows for interoperability with the C interface. * * \returns A reference to the internal mtapi_action_attributes_t structure. + * \waitfree */ mtapi_action_attributes_t const & GetInternal() const { return attributes_; diff --git a/mtapi_cpp/include/embb/mtapi/affinity.h b/mtapi_cpp/include/embb/mtapi/affinity.h index fbb3f86..07cc4c1 100644 --- a/mtapi_cpp/include/embb/mtapi/affinity.h +++ b/mtapi_cpp/include/embb/mtapi/affinity.h @@ -81,6 +81,8 @@ public: * Initializes an Affinity object with the given initial affinity. * If \c initial_affinity is \c true the Affinity will map to all worker * threads, otherwise it will map to no worker threads. + * + * \notthreadsafe */ void Init( bool initial_affinity /**< The initial affinity to set. */ @@ -93,6 +95,8 @@ public: /** * Sets affinity to the given worker. + * + * \notthreadsafe */ void Set( mtapi_uint_t worker, /**< The worker to set affinity to. */ @@ -108,6 +112,7 @@ public: * Gets affinity to the given worker. * * \returns \c true, if the Affinity maps to the worker, \c false otherwise. + * \waitfree */ bool Get( mtapi_uint_t worker /**< The worker to get affinity of. */ @@ -124,6 +129,7 @@ public: * Allows for interoperability with the C interface. * * \returns The internal mtapi_affinity_t. + * \waitfree */ mtapi_affinity_t GetInternal() const { return affinity_; diff --git a/mtapi_cpp/include/embb/mtapi/group.h b/mtapi_cpp/include/embb/mtapi/group.h index eef630c..8fefc53 100644 --- a/mtapi_cpp/include/embb/mtapi/group.h +++ b/mtapi_cpp/include/embb/mtapi/group.h @@ -102,6 +102,7 @@ class Group { * Starts a new Task in this Group. * * \returns The handle to the started Task. + * \threadsafe */ template Task Start( @@ -122,6 +123,7 @@ class Group { * Starts a new Task in this Group. * * \returns The handle to the started Task. + * \threadsafe */ template Task Start( @@ -141,6 +143,7 @@ class Group { * Starts a new Task in this Group. * * \returns The handle to the started Task. + * \threadsafe */ template Task Start( @@ -160,6 +163,7 @@ class Group { * Starts a new Task in this Group. * * \returns The handle to the started Task. + * \threadsafe */ template Task Start( @@ -260,6 +264,7 @@ class Group { * Allows for interoperability with the C interface. * * \returns The internal mtapi_group_hndl_t. + * \waitfree */ mtapi_group_hndl_t GetInternal() const { return handle_; diff --git a/mtapi_cpp/include/embb/mtapi/group_attributes.h b/mtapi_cpp/include/embb/mtapi/group_attributes.h index 68b1f83..5fb576d 100644 --- a/mtapi_cpp/include/embb/mtapi/group_attributes.h +++ b/mtapi_cpp/include/embb/mtapi/group_attributes.h @@ -54,6 +54,7 @@ public: * Allows for interoperability with the C interface. * * \returns A reference to the internal mtapi_group_attributes_t structure. + * \waitfree */ mtapi_group_attributes_t const & GetInternal() const { return attributes_; diff --git a/mtapi_cpp/include/embb/mtapi/job.h b/mtapi_cpp/include/embb/mtapi/job.h index dc91061..1972b87 100644 --- a/mtapi_cpp/include/embb/mtapi/job.h +++ b/mtapi_cpp/include/embb/mtapi/job.h @@ -85,6 +85,7 @@ public: * Allows for interoperability with the C interface. * * \returns The internal mtapi_job_hndl_t. + * \waitfree */ mtapi_job_hndl_t GetInternal() const { return handle_; diff --git a/mtapi_cpp/include/embb/mtapi/node.h b/mtapi_cpp/include/embb/mtapi/node.h index b451e09..41f4e00 100644 --- a/mtapi_cpp/include/embb/mtapi/node.h +++ b/mtapi_cpp/include/embb/mtapi/node.h @@ -166,6 +166,7 @@ class Node { * Starts a new Task. * * \returns The handle to the started Task. + * \threadsafe */ template Task Start( @@ -186,6 +187,7 @@ class Node { * Starts a new Task. * * \returns The handle to the started Task. + * \threadsafe */ template Task Start( @@ -205,6 +207,7 @@ class Node { * Starts a new Task. * * \returns The handle to the started Task. + * \threadsafe */ template Task Start( @@ -224,6 +227,7 @@ class Node { * Starts a new Task. * * \returns The handle to the started Task. + * \threadsafe */ template Task Start( diff --git a/mtapi_cpp/include/embb/mtapi/node_attributes.h b/mtapi_cpp/include/embb/mtapi/node_attributes.h index 36d9489..7874cf1 100644 --- a/mtapi_cpp/include/embb/mtapi/node_attributes.h +++ b/mtapi_cpp/include/embb/mtapi/node_attributes.h @@ -74,6 +74,7 @@ public: * worker threads. * * \returns Reference to this object. + * \notthreadsafe */ NodeAttributes & SetCoreAffinity( embb::base::CoreSet const & cores /**< The cores to use. */ @@ -89,6 +90,7 @@ public: * Sets the maximum number of concurrently active tasks. * * \returns Reference to this object. + * \notthreadsafe */ NodeAttributes & SetMaxTasks( mtapi_uint_t value /**< The value to set. */ @@ -104,6 +106,7 @@ public: * Sets the maximum number of actions. * * \returns Reference to this object. + * \notthreadsafe */ NodeAttributes & SetMaxActions( mtapi_uint_t value /**< The value to set. */ @@ -119,6 +122,7 @@ public: * Sets the maximum number of groups. * * \returns Reference to this object. + * \notthreadsafe */ NodeAttributes & SetMaxGroups( mtapi_uint_t value /**< The value to set. */ @@ -134,6 +138,7 @@ public: * Sets the maximum number of queues. * * \returns Reference to this object. + * \notthreadsafe */ NodeAttributes & SetMaxQueues( mtapi_uint_t value /**< The value to set. */ @@ -149,6 +154,7 @@ public: * Sets the default limit (capacity) of all queues. * * \returns Reference to this object. + * \notthreadsafe */ NodeAttributes & SetQueueLimit( mtapi_uint_t value /**< The value to set. */ @@ -164,6 +170,7 @@ public: * Sets the maximum number of available jobs. * * \returns Reference to this object. + * \notthreadsafe */ NodeAttributes & SetMaxJobs( mtapi_uint_t value /**< The value to set. */ @@ -179,6 +186,7 @@ public: * Sets the maximum number of actions per job. * * \returns Reference to this object. + * \notthreadsafe */ NodeAttributes & SetMaxActionsPerJob( mtapi_uint_t value /**< The value to set. */ @@ -195,6 +203,7 @@ public: * will range from 0 to \c value - 1 with 0 being the highest priority. * * \returns Reference to this object. + * \notthreadsafe */ NodeAttributes & SetMaxPriorities( mtapi_uint_t value /**< The value to set. */ @@ -211,6 +220,7 @@ public: * Allows for interoperability with the C interface. * * \returns A reference to the internal mtapi_node_attributes_t structure. + * \waitfree */ mtapi_node_attributes_t const & GetInternal() const { return attributes_; diff --git a/mtapi_cpp/include/embb/mtapi/queue.h b/mtapi_cpp/include/embb/mtapi/queue.h index f332e59..03e4a76 100644 --- a/mtapi_cpp/include/embb/mtapi/queue.h +++ b/mtapi_cpp/include/embb/mtapi/queue.h @@ -116,6 +116,7 @@ class Queue { * Enqueues a new Task. * * \returns The handle to the enqueued Task. + * \threadsafe */ template Task Enqueue( @@ -135,6 +136,7 @@ class Queue { * Enqueues a new Task. * * \returns The handle to the enqueued Task. + * \threadsafe */ template Task Enqueue( @@ -153,6 +155,7 @@ class Queue { * Enqueues a new Task. * * \returns The handle to the enqueued Task. + * \threadsafe */ template Task Enqueue( @@ -171,6 +174,7 @@ class Queue { * Enqueues a new Task. * * \returns The handle to the enqueued Task. + * \threadsafe */ template Task Enqueue( @@ -188,6 +192,7 @@ class Queue { * Enqueues a new Task. * * \returns The handle to the enqueued Task. + * \threadsafe */ template Task Enqueue( @@ -206,6 +211,7 @@ class Queue { * Enqueues a new Task. * * \returns The handle to the enqueued Task. + * \threadsafe */ template Task Enqueue( @@ -223,6 +229,7 @@ class Queue { * Enqueues a new Task. * * \returns The handle to the enqueued Task. + * \threadsafe */ template Task Enqueue( @@ -240,6 +247,7 @@ class Queue { * Enqueues a new Task. * * \returns The handle to the enqueued Task. + * \threadsafe */ template Task Enqueue( @@ -257,6 +265,7 @@ class Queue { * Allows for interoperability with the C interface. * * \returns The internal mtapi_queue_hndl_t. + * \waitfree */ mtapi_queue_hndl_t GetInternal() const { return handle_; diff --git a/mtapi_cpp/include/embb/mtapi/queue_attributes.h b/mtapi_cpp/include/embb/mtapi/queue_attributes.h index 3df364f..fe578f6 100644 --- a/mtapi_cpp/include/embb/mtapi/queue_attributes.h +++ b/mtapi_cpp/include/embb/mtapi/queue_attributes.h @@ -54,6 +54,7 @@ public: * This determines whether the object will be visible across nodes. * * \returns Reference to this object. + * \notthreadsafe */ QueueAttributes & SetGlobal( bool state /**< The state to set. */ @@ -71,6 +72,7 @@ public: * If set to \c true, tasks enqueued will be executed in order. * * \returns Reference to this object. + * \notthreadsafe */ QueueAttributes & SetOrdered( bool state /**< The state to set. */ @@ -89,6 +91,7 @@ public: * Otherwise the will be canceled. * * \returns Reference to this object. + * \notthreadsafe */ QueueAttributes & SetRetain( bool state /**< The state to set. */ @@ -106,6 +109,7 @@ public: * This determines whether the object will be visible across domains. * * \returns Reference to this object. + * \notthreadsafe */ QueueAttributes & SetDomainShared( bool state /**< The state to set. */ @@ -123,6 +127,7 @@ public: * The priority influences the order in which tasks are chosen for execution. * * \returns Reference to this object. + * \notthreadsafe */ QueueAttributes & SetPriority( mtapi_uint_t priority /**< The priority to set. */ @@ -138,6 +143,7 @@ public: * Sets the limit (capacity) of a Queue. * * \returns Reference to this object. + * \notthreadsafe */ QueueAttributes & SetLimit( mtapi_uint_t limit /**< The limit to set. */ @@ -154,6 +160,7 @@ public: * Allows for interoperability with the C interface. * * \returns A reference to the internal mtapi_queue_attributes_t structure. + * \waitfree */ mtapi_queue_attributes_t const & GetInternal() const { return attributes_; diff --git a/mtapi_cpp/include/embb/mtapi/status_exception.h b/mtapi_cpp/include/embb/mtapi/status_exception.h index 3c727a9..a69c78a 100644 --- a/mtapi_cpp/include/embb/mtapi/status_exception.h +++ b/mtapi_cpp/include/embb/mtapi/status_exception.h @@ -52,6 +52,7 @@ class StatusException : public embb::base::Exception { /** * Returns the code of the exception. + * \waitfree */ virtual int Code() const { return EMBB_ERROR; } }; diff --git a/mtapi_cpp/include/embb/mtapi/task.h b/mtapi_cpp/include/embb/mtapi/task.h index 5c91579..15172f2 100644 --- a/mtapi_cpp/include/embb/mtapi/task.h +++ b/mtapi_cpp/include/embb/mtapi/task.h @@ -114,6 +114,7 @@ class Task { * Allows for interoperability with the C interface. * * \returns The internal mtapi_task_hndl_t. + * \waitfree */ mtapi_task_hndl_t GetInternal() const { return handle_; diff --git a/mtapi_cpp/include/embb/mtapi/task_attributes.h b/mtapi_cpp/include/embb/mtapi/task_attributes.h index 1842a93..7848e96 100644 --- a/mtapi_cpp/include/embb/mtapi/task_attributes.h +++ b/mtapi_cpp/include/embb/mtapi/task_attributes.h @@ -55,6 +55,7 @@ public: * waited for. * * \returns Reference to this object. + * \notthreadsafe */ TaskAttributes & SetDetached( bool state /**< The state to set. */ @@ -72,6 +73,7 @@ public: * The priority influences the order in which tasks are chosen for execution. * * \returns Reference to this object. + * \notthreadsafe */ TaskAttributes & SetPriority( mtapi_uint_t priority /**< The priority to set. */ @@ -90,6 +92,7 @@ public: * the TaskContext. * * \returns Reference to this object. + * \notthreadsafe */ TaskAttributes & SetInstances( mtapi_uint_t instances /**< Number of instances to set. */ @@ -106,6 +109,7 @@ public: * Allows for interoperability with the C interface. * * \returns A reference to the internal mtapi_task_attributes_t structure. + * \waitfree */ mtapi_task_attributes_t const & GetInternal() const { return attributes_; diff --git a/mtapi_cpp/include/embb/mtapi/task_context.h b/mtapi_cpp/include/embb/mtapi/task_context.h index 489587f..a3dc0ed 100644 --- a/mtapi_cpp/include/embb/mtapi/task_context.h +++ b/mtapi_cpp/include/embb/mtapi/task_context.h @@ -129,6 +129,7 @@ class TaskContext { * Allows for interoperability with the C interface. * * \returns A pointer to a mtapi_task_context_t. + * \notthreadsafe */ mtapi_task_context_t * GetInternal() const { return context_; -- libgit2 0.26.0