mirror of
https://github.com/outbackdingo/parodus.git
synced 2026-01-27 18:20:04 +00:00
37 lines
839 B
C
37 lines
839 B
C
/**
|
|
* @file spin_thread.c
|
|
*
|
|
* @description This file is used to define thread function
|
|
*
|
|
* Copyright (c) 2015 Comcast
|
|
*/
|
|
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <pthread.h>
|
|
|
|
#include "spin_thread.h"
|
|
#include "parodus_log.h"
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
/* External Functions */
|
|
/*----------------------------------------------------------------------------*/
|
|
void StartThread(void *(*start_routine) (void *))
|
|
{
|
|
int err = 0;
|
|
pthread_t threadId;
|
|
|
|
err = pthread_create(&threadId, NULL, start_routine, NULL);
|
|
if (err != 0)
|
|
{
|
|
ParodusError("Error creating thread :[%s]\n", strerror(err));
|
|
exit(1);
|
|
}
|
|
else
|
|
{
|
|
ParodusPrint("Thread created Successfully %d\n", (int ) threadId);
|
|
}
|
|
}
|
|
|
|
|