Listener, Notification, Subscription module is renamed.
(to NetworkEventListener, Communication, InternalTaskController)
wrapper of listening for response is removed.
some of variables, functions, structures is renamed.
fixed bug about mutex lock and unlock at creation of thread.
waitting time is added in the thread function at queue scheduler.
Change-Id: Id76d5b0d23c67ec8b31d7cd51aad9d544ea516c9
Signed-off-by: KIM JungYong <jyong2.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/8413
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
return * NSGetBoneDiscoverCb();
}
-void * NSDiscoverdProviderFunc(void * provider)
+void * NSDiscoveredProviderFunc(void * provider)
{
NSGetDiscoverCb()((NSProvider *) provider);
void NSDiscoveredProvider(NSProvider * provider)
{
- if (!NSThreadInit(NSDiscoverdProviderFunc, (void *) provider))
+ if (!NSThreadInit(NSDiscoveredProviderFunc, (void *) provider))
{
NS_LOG(ERROR, "execute discovered provider callback fail");
return;
}
}
-onRIResponseListener * NSGetBoneResponseListener()
-{
- static onRIResponseListener g_responseCb = NULL;
-
- return & g_responseCb;
-}
-
-void NSSetResponseListener(onRIResponseListener cb)
-{
- * NSGetBoneResponseListener() = cb;
-}
-
-onRIResponseListener NSGetResponseListener()
-{
- return * NSGetBoneResponseListener();
-}
-
NSTask * NSMakeTask(NSTaskType type, void * data)
{
NSTask * retTask = OICMalloc(sizeof(NSTask));
msg = NULL;
}
-OCStackResult NSSendRequest(OCDoHandle * handle,
+OCStackResult NSInvokeRequest(OCDoHandle * handle,
OCMethod method, const OCDevAddr * addr,
- const char * queryUrl, OCPayload * payload, void * callback)
+ const char * queryUrl, OCPayload * payload,
+ void * callbackFunc, void * callbackData)
{
OCCallbackData cbdata;
- cbdata.cb = NSGetResponseListener();
- cbdata.context = callback;
+ cbdata.cb = callbackFunc;
+ cbdata.context = callbackData;
cbdata.cd = NULL;
return OCDoResource(handle, method, queryUrl, addr,
payload, CT_DEFAULT, NS_QOS, &cbdata, NULL, 0);
}
-
#define NS_DISCOVER_QUERY "/oic/res?rt=oic.r.notification"
-typedef OCStackApplicationResult (*onRIResponseListener)(
- void *, OCDoHandle, OCClientResponse *);
+#define NS_VERTIFY_NOT_NULL(obj, retVal) { if ((obj) == NULL) \
+ { \
+ NS_LOG_V(ERROR, "%s : obj is null", __func__); \
+ return (retVal); \
+ }}
+
+#define NS_VERTIFY_NOT_NULL_WITH_POST_CLEANING(obj, retVal, func) { \
+ if ((obj) == NULL) \
+ { \
+ NS_LOG_V(ERROR, "%s : obj is null", __func__); \
+ NS_LOG(ERROR, "execute deletion"); \
+ (func); \
+ return (retVal); \
+ }}
+
+#define NS_VERTIFY_STACK_OK(obj, retVal) { if ((obj) != OC_STACK_OK) \
+ { \
+ NS_LOG_V(ERROR, "%s : obj is not OC_STACK_OK", __func__); \
+ return (retVal); \
+ }}
typedef enum
{
void NSSetNotificationSyncCb(NSSyncCallback cb);
void NSNotificationSync(NSProvider * provider, NSSync * sync);
-onRIResponseListener NSGetResponseListener();
-void NSSetResponseListener(onRIResponseListener cb);
-
NSTask * NSMakeTask(NSTaskType, void *);
NSResult NSConsumerPushEvent(NSTask *);
NSMessage_consumer * NSCopyMessage(NSMessage_consumer *);
void NSRemoveMessage(NSMessage_consumer *);
-OCStackResult NSSendRequest(OCDoHandle * handle,
+OCStackResult NSInvokeRequest(OCDoHandle * handle,
OCMethod method, const OCDevAddr * addr,
- const char * queryUrl, OCPayload * payload, void * callback);
+ const char * queryUrl, OCPayload * payload,
+ void * callbackFunc, void * callbackData);
#ifdef __cplusplus
}
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-#include "NSConsumerNotification.h"
-
#include "NSConstants.h"
#include "NSConsumerCommon.h"
+#include "NSConsumerCommunication.h"
#include "oic_malloc.h"
#include "oic_string.h"
#include "ocpayload.h"
const char NS_MESSAGE_ACCEPTANCE[] = "0000-0000-0000-0000";
-NSMessage_consumer * NSBuildOICNotification(OCClientResponse * clientResponse);
-NSSync * NSBuildOICNotificationSync(OCClientResponse * clientResponse);
+NSMessage_consumer * NSGetNSMessage(OCClientResponse * clientResponse);
+NSSync * NSGetNSSyncInfo(OCClientResponse * clientResponse);
-NSProvider * NSGetProvider(OCClientResponse * clientResponse);
+NSProvider * NSGetNSProvider(OCClientResponse * clientResponse);
NSResult NSPushToCache(OCClientResponse * clientResponse, NSTaskType type);
NSResult NSConsumerSubscribeProvider(NSProvider * provider)
{
- if (OC_STACK_OK != NSSendRequest(&(provider->messageHandle),
+ if (OC_STACK_OK != NSInvokeRequest(&(provider->messageHandle),
OC_REST_OBSERVE, (OCDevAddr *) provider->mUserData,
- provider->messageUri, NULL, NSConsumerNotificationListener))
+ provider->messageUri, NULL, NSConsumerMessageListener, NULL))
{
return NS_ERROR;
}
- if (OC_STACK_OK != NSSendRequest(&(provider->syncHandle),
+ if (OC_STACK_OK != NSInvokeRequest(&(provider->syncHandle),
OC_REST_OBSERVE, (OCDevAddr *) provider->mUserData,
- provider->syncUri, NULL, NSConsumerSyncListener))
+ provider->syncUri, NULL, NSConsumerSyncInfoListener, NULL))
{
return NS_ERROR;
}
NSResult NSConsumerPostProvider(OCDevAddr * addr, OCPayload * payload, const char * uri)
{
-
- if (OC_STACK_OK != NSSendRequest(NULL, OC_REST_POST, addr,
- uri, payload, NULL))
+ if (OC_STACK_OK != NSInvokeRequest(NULL, OC_REST_POST, addr, uri, payload, NULL, NULL))
{
return NS_ERROR;
}
return NS_OK;
}
-OCStackApplicationResult NSConsumerSyncListener(
- OCDoHandle handle, OCClientResponse * clientResponse)
+OCStackApplicationResult NSConsumerSyncInfoListener(
+ void * ctx, OCDoHandle handle, OCClientResponse * clientResponse)
{
+ (void) ctx;
(void) handle;
+ NS_VERTIFY_NOT_NULL(clientResponse, OC_STACK_KEEP_TRANSACTION);
+ NS_VERTIFY_STACK_OK(clientResponse->result, OC_STACK_KEEP_TRANSACTION);
+
NSSync * newNoti = NULL;
- NSProvider * provider = NSGetProvider(clientResponse);
+ NSProvider * provider = NSGetNSProvider(clientResponse);
if (!provider)
{
NS_LOG(ERROR, "getting provider is failed");
return OC_STACK_KEEP_TRANSACTION;
}
- newNoti = NSBuildOICNotificationSync(clientResponse);
+ newNoti = NSGetNSSyncInfo(clientResponse);
if (!newNoti)
{
return OC_STACK_KEEP_TRANSACTION;
return OC_STACK_KEEP_TRANSACTION;
}
-OCStackApplicationResult NSConsumerNotificationListener(
- OCDoHandle handle, OCClientResponse * clientResponse)
+OCStackApplicationResult NSConsumerMessageListener(
+ void * ctx, OCDoHandle handle, OCClientResponse * clientResponse)
{
+ (void) ctx;
(void) handle;
- NSProvider * provider = NSGetProvider(clientResponse);
+ NS_VERTIFY_NOT_NULL(clientResponse, OC_STACK_KEEP_TRANSACTION);
+ NS_VERTIFY_STACK_OK(clientResponse->result, OC_STACK_KEEP_TRANSACTION);
+
+ NSProvider * provider = NSGetNSProvider(clientResponse);
if (!provider)
{
NS_LOG(ERROR, "getting provider is failed");
return OC_STACK_KEEP_TRANSACTION;
}
- NSMessage_consumer * newNoti = NSBuildOICNotification(clientResponse);
+ NSMessage_consumer * newNoti = NSGetNSMessage(clientResponse);
if (!newNoti)
{
return OC_STACK_KEEP_TRANSACTION;
NSResult NSPushToCache(OCClientResponse * clientResponse, NSTaskType type)
{
- NSMessage_consumer * cachedNoti = NSBuildOICNotification(clientResponse);
+ NSMessage_consumer * cachedNoti = NSGetNSMessage(clientResponse);
if (!cachedNoti)
{
return NS_ERROR;
return NS_OK;
}
-NSMessage_consumer * NSBuildOICNotification(OCClientResponse * clientResponse)
+NSMessage_consumer * NSGetNSMessage(OCClientResponse * clientResponse)
{
if(!clientResponse->payload)
{
return retNoti;
}
-NSSync * NSBuildOICNotificationSync(OCClientResponse * clientResponse)
+NSSync * NSGetNSSyncInfo(OCClientResponse * clientResponse)
{
if(!clientResponse->payload)
{
return retSync;
}
-NSProvider * NSGetProvider(OCClientResponse * clientResponse)
+NSProvider * NSGetNSProvider(OCClientResponse * clientResponse)
{
NSProvider * newProvider = (NSProvider *)OICMalloc(sizeof(NSProvider));
if (!newProvider)
NSResult NSConsumerSubscribeProvider(NSProvider *);
NSResult NSConsumerPostProvider(OCDevAddr *, OCPayload *, const char *);
-OCStackApplicationResult NSConsumerNotificationListener(OCDoHandle, OCClientResponse *);
+OCStackApplicationResult NSConsumerMessageListener(void *, OCDoHandle, OCClientResponse *);
-OCStackApplicationResult NSConsumerSyncListener(OCDoHandle, OCClientResponse *);
+OCStackApplicationResult NSConsumerSyncInfoListener(void *, OCDoHandle, OCClientResponse *);
#ifdef __cplusplus
}
}
OCStackApplicationResult NSConsumerPresenceListener(
- OCDoHandle handle, OCClientResponse * clientResponse)
+ void * ctx, OCDoHandle handle, OCClientResponse * clientResponse)
{
+ (void) ctx;
(void) handle;
+
+ NS_VERTIFY_NOT_NULL(clientResponse, OC_STACK_KEEP_TRANSACTION);
+ NS_VERTIFY_STACK_OK(clientResponse->result, OC_STACK_KEEP_TRANSACTION);
+
NS_LOG_V(DEBUG, "Presence income : %s:%d",
clientResponse->devAddr.addr, clientResponse->devAddr.port);
NS_LOG_V(DEBUG, "Presence result : %d",
else if (payload->trigger == OC_PRESENCE_TRIGGER_CREATE)
{
- NSSendRequest(NULL, OC_REST_DISCOVER, clientResponse->addr,
- NS_DISCOVER_QUERY, NULL, NSProviderDiscoverListener);
+ NSInvokeRequest(NULL, OC_REST_DISCOVER, clientResponse->addr,
+ NS_DISCOVER_QUERY, NULL, NSProviderDiscoverListener, NULL);
}
return OC_STACK_KEEP_TRANSACTION;
}
OCStackApplicationResult NSProviderDiscoverListener(
- OCDoHandle handle, OCClientResponse * clientResponse)
+ void * ctx, OCDoHandle handle, OCClientResponse * clientResponse)
{
+ (void) ctx;
(void) handle;
+
+ NS_VERTIFY_NOT_NULL(clientResponse, OC_STACK_KEEP_TRANSACTION);
+ NS_VERTIFY_STACK_OK(clientResponse->result, OC_STACK_KEEP_TRANSACTION);
+
NS_LOG_V(DEBUG, "Discover income : %s:%d",
clientResponse->devAddr.addr, clientResponse->devAddr.port);
NS_LOG_V(DEBUG, "Discover result : %d",
{
if (!strcmp(resource->uri, NS_RESOURCE_URI))
{
- NSSendRequest(
- NULL, OC_REST_GET, clientResponse->addr,
- NS_RESOURCE_URI, NULL, NSIntrospectProvider);
+ NSInvokeRequest(NULL, OC_REST_GET, clientResponse->addr,
+ NS_RESOURCE_URI, NULL, NSIntrospectProvider, NULL);
}
resource = resource->next;
}
}
OCStackApplicationResult NSIntrospectProvider(
- OCDoHandle handle, OCClientResponse * clientResponse)
+ void * ctx, OCDoHandle handle, OCClientResponse * clientResponse)
{
+ (void) ctx;
(void) handle;
+
+ NS_VERTIFY_NOT_NULL(clientResponse, OC_STACK_KEEP_TRANSACTION);
+ NS_VERTIFY_STACK_OK(clientResponse->result, OC_STACK_KEEP_TRANSACTION);
+
int64_t accepter = 0;
NS_LOG_V(DEBUG, "GET response income : %s:%d",
NS_LOG_V(DEBUG, "Receive Event : %d", (int)task->taskType);
if (task->taskType == TASK_EVENT_CONNECTED || task->taskType == TASK_CONSUMER_REQ_DISCOVER)
{
- NSSendRequest(NULL, OC_REST_DISCOVER, NULL, NS_DISCOVER_QUERY,
- NULL, NSProviderDiscoverListener);
+ NSInvokeRequest(NULL, OC_REST_DISCOVER, NULL, NS_DISCOVER_QUERY,
+ NULL, NSProviderDiscoverListener, NULL);
}
else
{
void NSConsumerDiscoveryTaskProcessing(NSTask *);
-OCStackApplicationResult NSConsumerPresenceListener(OCDoHandle, OCClientResponse *);
+OCStackApplicationResult NSConsumerPresenceListener(void *, OCDoHandle, OCClientResponse *);
// for discover result
-OCStackApplicationResult NSProviderDiscoverListener(OCDoHandle, OCClientResponse *);
+OCStackApplicationResult NSProviderDiscoverListener(void *, OCDoHandle, OCClientResponse *);
// for checking Permission
-OCStackApplicationResult NSIntrospectProvider(OCDoHandle, OCClientResponse *);
+OCStackApplicationResult NSIntrospectProvider(void *, OCDoHandle, OCClientResponse *);
#ifdef __cplusplus
}
#include "NSCommon.h"
#include "NSConsumerCommon.h"
#include "NSConstants.h"
-#include "NSConsumerMessageHandler.h"
+#include "NSConsumerQueueScheduler.h"
#include "oic_malloc.h"
// Public APIs
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-#include "NSConsumerSubsription.h"
-
#include "NSConstants.h"
#include "NSConsumerCommon.h"
+#include "NSConsumerInternalTaskController.h"
#include "NSStructs.h"
#include "oic_malloc.h"
#endif // __cplusplus
#include "NSStructs.h"
-#include "../common/NSStorageAdapter.h"
-#include "NSConsumerNotification.h"
+#include "NSStorageAdapter.h"
+#include "NSConsumerCommunication.h"
void NSDestroyCacheList();
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-#include "NSConsumerListener.h"
-
#include <memory.h>
#include <string.h>
#include "NSConstants.h"
#include "NSConsumerCommon.h"
-#include "payload_logging.h"
#include "cautilinterface.h"
#include "NSConsumerDiscovery.h"
+#include "NSConsumerNetworkEventListener.h"
#define NS_PRESENCE_SUBSCRIBE_QUERY "coap://224.0.1.187:5683/oic/ad?rt=oic.r.notification"
-typedef OCStackApplicationResult(*onRIResponse)(OCDoHandle, OCClientResponse *);
-
-OCStackApplicationResult NSRIResponseListener(
- void * ctx, OCDoHandle handle, OCClientResponse * clientResponse);
-
void NSConnectionStateListener(CATransportAdapter_t adapter,
const char *remote_address, bool connected);
NSResult NSConsumerListenerInit()
{
- NSSetResponseListener(NSRIResponseListener);
-
// TODO replace with comment lines when enable network monitor of IP Adapter
CARegisterNetworkMonitorHandler(NSAdapterStateListener, NSConnectionStateListener);
// if (CARegisterNetworkMonitorHandler(NSAdapterStateListener, NSConnectionStateListener)
// return NS_ERROR;
// }
- if (OC_STACK_OK != NSSendRequest(NULL, OC_REST_PRESENCE, NULL,
- NS_PRESENCE_SUBSCRIBE_QUERY, NULL, NSConsumerPresenceListener))
+ if (OC_STACK_OK != NSInvokeRequest(NULL, OC_REST_PRESENCE, NULL,
+ NS_PRESENCE_SUBSCRIBE_QUERY, NULL, NSConsumerPresenceListener, NULL))
{
NS_LOG(ERROR, "Presence request fail");
return NS_ERROR;
}
- if (OC_STACK_OK != NSSendRequest(NULL, OC_REST_DISCOVER, NULL,
- NS_DISCOVER_QUERY, NULL, NSProviderDiscoverListener))
+ if (OC_STACK_OK != NSInvokeRequest(NULL, OC_REST_DISCOVER, NULL,
+ NS_DISCOVER_QUERY, NULL, NSProviderDiscoverListener, NULL))
{
NS_LOG(ERROR, "Discover request fail");
return NS_ERROR;
return NS_OK;
}
-OCStackApplicationResult NSRIResponseListener(
- void * ctx, OCDoHandle handle, OCClientResponse * clientResponse)
-{
- if (ctx == NULL)
- {
- NS_LOG(ERROR, "Callback is null");
- return OC_STACK_DELETE_TRANSACTION;
- }
-
- if (clientResponse->result == OC_STACK_OK && clientResponse != NULL)
- {
- OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
- ((onRIResponse)ctx)(handle, clientResponse);
- }
- else
- {
- NS_LOG_V(ERROR, "result is not ok : %d", clientResponse->result);
- }
-
- return OC_STACK_KEEP_TRANSACTION;
-}
-
void NSConnectionStateListener(CATransportAdapter_t adapter,
const char *remote_address, bool connected)
{
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-#include "NSConsumerMessageHandler.h"
-
#include <stdlib.h>
#include <stdbool.h>
+#include <unistd.h>
#include "oic_malloc.h"
#include "NSStructs.h"
#include "NSConstants.h"
#include "NSConsumerCommon.h"
+#include "NSConsumerCommunication.h"
#include "NSThread.h"
#include "NSConsumerQueue.h"
-#include "NSConsumerListener.h"
#include "NSConsumerDiscovery.h"
+#include "NSConsumerInternalTaskController.h"
+#include "NSConsumerNetworkEventListener.h"
+#include "NSConsumerQueueScheduler.h"
#include "NSConsumerSystem.h"
-#include "NSConsumerNotification.h"
-#include "NSConsumerSubsription.h"
void * NSConsumerMsgHandleThreadFunc(void * handle);
void NSConsumerTaskProcessing(NSTask * task);
-NSThread ** NSGetMsgHandleThreadHandle()
+NSConsumerThread ** NSGetMsgHandleThreadHandle()
{
- static NSThread * handle = NULL;
+ static NSConsumerThread * handle = NULL;
return & handle;
}
-void NSSetMsgHandleThreadHandle(NSThread * handle)
+void NSSetMsgHandleThreadHandle(NSConsumerThread * handle)
{
*(NSGetMsgHandleThreadHandle()) = handle;
}
NSResult NSConsumerMessageHandlerInit()
{
- NSThread * handle = NULL;
+ NSConsumerThread * handle = NULL;
NSConsumerQueue * queue = NULL;
if (NS_OK != NSConsumerListenerInit())
{
NSConsumerQueue * queue = NULL;
NSConsumerQueueObject * obj = NULL;
- NSThread * handle = (NSThread *) threadHandle;
+ NSConsumerThread * queueHandleThread = (NSConsumerThread *) threadHandle;
NS_LOG(DEBUG, "created thread for consumer message handle");
- if (!handle)
+ if (!queueHandleThread)
{
NS_LOG(ERROR, "thread handle is null");
return NULL;
while (true)
{
- if (!handle->isStarted)
+ if (!queueHandleThread->isStarted)
{
NS_LOG(ERROR, "msg handler thread will be terminated");
break;
if (NSIsQueueEmpty(queue))
{
+ usleep(2000);
continue;
}
- NSThreadLock(handle);
+ NSThreadLock(queueHandleThread);
NS_LOG(DEBUG, "msg handler working");
obj = NSPopQueue(queue);
NSConsumerTaskProcessing((NSTask *)(obj->data));
}
- NSThreadUnlock(handle);
+ NSThreadUnlock(queueHandleThread);
}
{
NSConsumerQueueObject * obj = NULL;
NSConsumerQueue * queue = NULL;
- NSThread * msgHandleThread = *(NSGetMsgHandleThreadHandle());
+ NSConsumerThread * msgHandleThread = *(NSGetMsgHandleThreadHandle());
if (!msgHandleThread)
{
NS_LOG(ERROR, "NSThreadHandle is null. can not insert to queue");
#include <memory.h>
#include "oic_malloc.h"
-void NSDestroyThreadHandle(NSThread *);
+static pthread_mutex_t g_create_mutex;
-NSThread * NSThreadInit(NSThreadFunc func, void * data)
+void NSDestroyThreadHandle(NSConsumerThread *);
+
+NSConsumerThread * NSThreadInit(NSThreadFunc func, void * data)
{
if (!func)
{
return NULL;
}
- NSThread * handle = (NSThread *)OICMalloc(sizeof(NSThread));
+ pthread_mutex_init(&g_create_mutex, NULL);
+
+ NSConsumerThread * handle = (NSConsumerThread *)OICMalloc(sizeof(NSConsumerThread));
if (!handle)
{
NS_LOG(ERROR, "thread allocation fail");
return NULL;
}
- memset(handle, 0, sizeof(NSThread));
+ memset(handle, 0, sizeof(NSConsumerThread));
pthread_mutexattr_init(&(handle->mutex_attr));
if (pthread_mutexattr_settype(&(handle->mutex_attr), PTHREAD_MUTEX_RECURSIVE))
return NULL;
}
- if (pthread_mutex_lock(&(handle->mutex)))
- {
- NS_LOG(ERROR, "thread mutex lock fail");
- NSDestroyThreadHandle(handle);
- return NULL;
- }
+ pthread_mutex_lock(&g_create_mutex);
handle->isStarted = true;
NSDestroyThreadHandle(handle);
return NULL;
}
-
- pthread_mutex_unlock(&(handle->mutex));
+ pthread_mutex_unlock(&g_create_mutex);
return handle;
}
-void NSThreadLock(NSThread * handle)
+void NSThreadLock(NSConsumerThread * handle)
{
pthread_mutex_lock(&(handle->mutex));
}
-void NSThreadUnlock(NSThread * handle)
+void NSThreadUnlock(NSConsumerThread * handle)
{
pthread_mutex_unlock(&(handle->mutex));
}
-void NSThreadStop(NSThread * handle)
+void NSThreadStop(NSConsumerThread * handle)
{
NSDestroyThreadHandle(handle);
}
-void NSThreadJoin(NSThread * handle)
+void NSThreadJoin(NSConsumerThread * handle)
{
if (handle->thread_id)
{
}
}
-void NSDestroyThreadHandle(NSThread * handle)
+void NSDestroyThreadHandle(NSConsumerThread * handle)
{
handle->isStarted = false;
pthread_t thread_id;
pthread_mutex_t mutex;
pthread_mutexattr_t mutex_attr;
-} NSThread;
+} NSConsumerThread;
+
#endif
typedef void *(*NSThreadFunc)(void *);
-NSThread * NSThreadInit(NSThreadFunc, void *);
+NSConsumerThread * NSThreadInit(NSThreadFunc, void *);
-void NSThreadLock(NSThread *);
+void NSThreadLock(NSConsumerThread *);
-void NSThreadUnlock(NSThread *);
+void NSThreadUnlock(NSConsumerThread *);
-void NSThreadJoin(NSThread *);
+void NSThreadJoin(NSConsumerThread *);
-void NSThreadStop(NSThread *);
+void NSThreadStop(NSConsumerThread *);
#ifdef __cplusplus
}