You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
879 B

// CrossThreads
// Copyright Jeroen Saey
// Created 29-01-2013
// CrossThreads.h
#pragma once
#ifndef __WIN32__
#include "pthread.h"
typedef pthread_t threadID;
typedef void* (*threadCallBack)(void* parameter);
#include <windows.h>
typedef unsigned long (*threadCallBack)(void* parameter);
typedef DWORD threadID;
class CrossThreads
CrossThreads(threadCallBack callBack = NULL, long timeout = 3000);
virtual ~CrossThreads();
void setThreadCallback(threadCallBack callBack);
unsigned long getThreadID();
int create();
int remove();
void join();
bool isCreated();
threadID _threadID;
threadCallBack _callBack;
#ifdef __WIN32__
long _timeout;
HANDLE _thread;
void stop();