/**************************** SILC Thread API *******************************/
+extern "C" {
+
/* Thread structure for Symbian */
typedef struct {
#ifdef SILC_THREADS
#ifdef SILC_THREADS
SilcSymbianThread tc = (SilcSymbianThread)context;
SilcThreadStart start_func = tc->start_func;
- void *context = tc->context;
+ void *user_context = tc->context;
SilcBool waitable = tc->waitable;
silc_free(tc);
/* Call the thread function */
if (waitable)
- silc_thread_exit(start_func(context));
+ silc_thread_exit(start_func(user_context));
else
- start_func(context);
+ start_func(user_context);
#endif
return KErrNone;
/* Executed new thread */
SilcThread silc_thread_create(SilcThreadStart start_func, void *context,
- bool waitable)
+ SilcBool waitable)
{
#ifdef SILC_THREADS
SilcSymbianThread tc;
void silc_thread_exit(void *exit_value)
{
#ifdef SILC_THREADS
- RThread().Kill((Tint)exit_value);
+ RThread().Kill((TInt)exit_value);
#endif
}
SilcThread silc_thread_self(void)
{
#ifdef SILC_THREADS
- return (SilcThread)&RThread();
+ RThread thread = RThread();
+ return (SilcThread)&thread;
#else
return NULL;
#endif
void silc_rwlock_free(SilcRwLock rwlock)
{
#ifdef SILC_THREADS
- if (mutex) {
+ if (rwlock) {
silc_mutex_free(rwlock->mutex);
silc_cond_free(rwlock->cond);
silc_free(rwlock);
return FALSE;
#endif /* SILC_THREADS*/
}
+
+} /* extern "C" */
\ No newline at end of file