Click here to Skip to main content
15,896,606 members
Articles / Programming Languages / C++

Cross Platform Threads

Rate me:
Please Sign up or sign in to vote.
2.19/5 (12 votes)
15 Oct 2006CPOL2 min read 44.7K   553   13  
A cross platform thread class.
/*******************************************************************************
** FILE:			ThreadTest.cpp

** DESCRIPTION: 	Main file. 

** AUTHOR:			Amit Gupta

** CREATED:			07-OCT-2006
********************************************************************************/

#include <iostream>
#include "XPThreads.h"

using namespace std;

void* Entry (void* param);

void* Entry (void* param)
{
#pragma unused(param) 

	cout<<"In the thread" << endl;
	
	return NULL;
}

int main()
{	
	cout << "Thread is about to execute" << endl;
	
	XPThreads* ptrThread = new XPThreads(Entry);
	ptrThread->Run();
	delete ptrThread;

	cout << " Thread execution finish" << endl;
	
	return 0;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Product Manager MetaDesign Solutions
India India
Senior Software Developer with special skills in Developing Applications for Macintosh and Windows.

Comments and Discussions