#include <stdint.h>
#include "cathreadpool.h"
-#include "camutex.h"
+#include "octhread.h"
#include "uqueue.h"
#include "cacommon.h"
#ifdef __cplusplus
/** Data destroy function. **/
typedef void (*CADataDestroyFunction)(void *data, uint32_t size);
+/** Context based Data destroy function. **/
+typedef bool (*CAContextDataDestroy)(void *data, uint32_t size, void *ctx);
+
typedef struct
{
/** Thread pool of the thread started. **/
ca_thread_pool_t threadPool;
/** mutex for synchronization. **/
- ca_mutex threadMutex;
+ oc_mutex threadMutex;
/** conditional mutex for synchronization. **/
- ca_cond threadCond;
+ oc_cond threadCond;
/** Thread function to be invoked. **/
CAThreadTask threadTask;
/** Data destroy function. **/
* @param[in] thread thread data that needs to be started.
* @return CA_STATUS_OK or ERROR CODES (CAResult_t error codes in cacommon.h).
*/
+#ifndef __TIZENRT__
CAResult_t CAQueueingThreadStart(CAQueueingThread_t *thread);
-
+#else
+CAResult_t CAQueueingThreadStart(CAQueueingThread_t *thread, const char *thread_name);
+#endif
/**
* Add queuing thread data for new thread.
* @param[in] thread thread data for new thread control.
CAResult_t CAQueueingThreadAddData(CAQueueingThread_t *thread, void *data, uint32_t size);
/**
+ * Clears queue thread data.
+ * @param[in] thread thread data for new thread control.
+ * @return ::CA_STATUS_OK or Appropriate error code.
+ */
+CAResult_t CAQueueingThreadClearData(CAQueueingThread_t *thread);
+
+/**
+ * Clears queue thread data of specific context.
+ * @param[in] thread thread data for new thread control.
+ * @param[in] callback Function which should return true if the data
+ * needs to be deleted, else returns false
+ * @param[in] ctx Data to pass to callback
+ */
+CAResult_t CAQueueingThreadClearContextData(CAQueueingThread_t *thread,
+ CAContextDataDestroy callback, void *ctx);
+
+/**
* Stop the queuing thread.
* @param[in] thread thread data that needs to be started.
* @return CA_STATUS_OK or ERROR CODES (CAResult_t error codes in cacommon.h).