X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fc_common%2Focthread%2Fsrc%2Fnoop%2Focthread.c;fp=resource%2Fcsdk%2Fconnectivity%2Fcommon%2Fsrc%2Fcamutex_noop.c;h=43e2bb6d8fa3020f9b52df4985cb306254f7aa4a;hb=7f00f942c39b7bc27c7eeecf213a239c3fe4173c;hp=08b1c1e3174516838c3719f5262340df07075a7a;hpb=edcfc3d2329da7b914771c0dcff5f42c9b74fd93;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/csdk/connectivity/common/src/camutex_noop.c b/resource/c_common/octhread/src/noop/octhread.c similarity index 56% rename from resource/csdk/connectivity/common/src/camutex_noop.c rename to resource/c_common/octhread/src/noop/octhread.c index 08b1c1e..43e2bb6 100644 --- a/resource/csdk/connectivity/common/src/camutex_noop.c +++ b/resource/c_common/octhread/src/noop/octhread.c @@ -26,8 +26,7 @@ * This file provides APIs related to mutex with no operation * for Singlethread implementation. */ - -#include "camutex.h" +#include "octhread.h" /** * TAG @@ -37,77 +36,91 @@ typedef struct _tagMutexInfo_t { -#if defined(_MSC_VER) - uint8_t unused; //VS doesnt like empty structs -#endif -} ca_mutex_internal; +} oc_mutex_internal; typedef struct _tagEventInfo_t { -#if defined(_MSC_VER) - uint8_t unused; //VS doesnt like empty structs -#endif -} ca_cond_internal; +} oc_cond_internal; + +typedef struct _tagThreadInfo_t +{ +} oc_thread_internal; + /** * @var g_mutexInfo - * @brief This is used to return a non NULL value for ca_mutex_new(). + * @brief This is used to return a non NULL value for oc_mutex_new(). */ -static ca_mutex_internal g_mutexInfo = { 0 }; +static oc_mutex_internal g_mutexInfo = { 0 }; /** * @var g_condInfo - * @brief This is used to return a non NULL value for ca_cond_new(). + * @brief This is used to return a non NULL value for oc_cond_new(). */ -static ca_cond_internal g_condInfo = { 0 }; +static oc_cond_internal g_condInfo = { 0 }; + +OCThreadResult_t oc_thread_new(oc_thread *t, void *(*start_routine)(void *), void *arg) +{ + return OC_THREAD_CREATE_FAILURE; +} + +OCThreadResult_t oc_thread_free(oc_thread t) +{ + return OC_THREAD_INVALID; +} + +OCThreadResult_t oc_thread_wait(oc_thread t) +{ + return OC_THREAD_INVALID; +} -ca_mutex ca_mutex_new(void) +oc_mutex oc_mutex_new(void) { - return (ca_mutex)&g_mutexInfo; + return (oc_mutex)&g_mutexInfo; } -bool ca_mutex_free(ca_mutex mutex) +bool oc_mutex_free(oc_mutex mutex) { return true; } -void ca_mutex_lock(ca_mutex mutex) +void oc_mutex_lock(oc_mutex mutex) { return; } -void ca_mutex_unlock(ca_mutex mutex) +void oc_mutex_unlock(oc_mutex mutex) { return; } -ca_cond ca_cond_new(void) +oc_cond oc_cond_new(void) { - return (ca_cond)&g_condInfo; + return (oc_cond)&g_condInfo; } -void ca_cond_free(ca_cond cond) +void oc_cond_free(oc_cond cond) { return; } -void ca_cond_signal(ca_cond cond) +void oc_cond_signal(oc_cond cond) { return; } -void ca_cond_broadcast(ca_cond cond) +void oc_cond_broadcast(oc_cond cond) { return; } -void ca_cond_wait(ca_cond cond, ca_mutex mutex) +void oc_cond_wait(oc_cond cond, oc_mutex mutex) { return; } -CAWaitResult_t ca_cond_wait_for(ca_cond cond, ca_mutex mutex, uint64_t microseconds) +OCWaitResult_t oc_cond_wait_for(oc_cond cond, oc_mutex mutex, uint64_t microseconds) { - return CA_WAIT_SUCCESS; + return OC_WAIT_SUCCESS; }